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>
<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>