Click to See Complete Forum and Search --> : Two tables with different attributes. How to mark them??


codingisfun
02-24-2009, 11:46 AM
I have two tables - Table1 and Table2. How to mark them differently using CSS?



<style type="text/css">
#table1 tr {
background:red;
}

#table2 tr {
background:blue;
}

</style>

<table id="table1">
<thead>
<tr><td>Name</td><td>Address</td></tr>
</thead>
<tbody>
<tr><td>Joe</td><td>California</td></tr>
</tbody>
</table>
<table id="table2">
<th><td>Name</td><td>Address</td></th>
<tr><td>Doe</td><td>China</td></tr>
</table>

Charles
02-24-2009, 11:50 AM
That should do it. Aside from using TD elements where you should be using TH, What seems to be the problem?