Forum Moderators: not2easy
For instance if i give the table a class of difTable, i then want to be able to use:
#diffTable:TH
#diffTable:TD
I don't want to have to put a class in every td or th
Am i making sense? I can't work out how to do this, would appreciate a point in the right direction... if its possible ofcourse
Thanks
If you are styling table cells and headers inside a table with the class of difTable then your CSS would use
table.difTable th {...}
table.difTable td {...}
with the html <table class="difTable"> . If they are to have the same definition, i.e. if td and th content is to be styled identically, you can put them on one line separated by a comma:
table.difTable th, table.difTable td {...}
Similarly, if the table is unique within the page, you can use an id, i.e. <table id="difTable"> and using "#" instead of "." in the selector.