Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove all inherited CSS formatting for a table?

I have a table which has a certain style due to the CSS file for the page (it has blue borders, etc...).

Is there a simple way to remove the CSS for that specific table? I was thinking something along the lines of a command like:

style="nostyle" 

Does anything like this exist?

like image 368
chris Avatar asked Jun 09 '09 08:06

chris


People also ask

How remove all table borders CSS?

Set the CSS border Property to none to Remove Border From a Table in HTML. We can set the border property to none to remove the border from an HTML table. The property is short-hand of different border properties. Those different properties are border-width , border-style and border-color .

How do you unset a CSS style?

Use the revert keyword to reset a property to the value established by the user-agent stylesheet (or by user styles, if any exist). Use the revert-layer keyword to reset a property to the value established in a previous cascade layer.

How do you override inherited CSS styles?

Identify the element with inherited style by right-clicking the element and select Inspect Element within your browser. A console appears, and the element is highlighted on the page. Right-click the element and select Copy > Copy selector. You will paste this selector into your variation code.

How do you stop inheriting in CSS?

Using the wildcard * selector in CSS to override inheritance for all attributes of an element (by setting these back to their initial state).


1 Answers

Try this.

From Eric Meyer's Reset CSS

table, caption, tbody, tfoot, thead, tr, th, td {     margin: 0;     padding: 0;     border: 0;     outline: 0;     font-size: 100%;     vertical-align: baseline;     background: transparent; } 
like image 74
Kristof Neirynck Avatar answered Sep 29 '22 09:09

Kristof Neirynck