Wilson Wilson - 1 month ago 7
CSS Question

Easy styling of all Td's in a table or in a div

Is there a way I can use one category to stylize all of my table cells? I cant just use

td{

}


because I have another table on the same page that I don't want the same style on. The table I want to stylize has around 40 cells, so is there a way to collectively style them short of copy-pasting a class or id 40 times?

Answer

Put a selector on the table tag:

<table class="my-special-table">
<tr><td></td></tr>
</table>

table.my-special-table td { style it up! }
Comments