Tuesday, July 6, 2010

css highlight table row column tr td with color

css highlight table row column tr td with color

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
<head>

<style>
table.test{ border: 1px solid #666}
tr.testtr{border: 1px solid #666} 
tr.testtr:hover{background-color:lightgrey;border: 1px solid #666} 
td.testtd:hover{ background-color:white; border: 1px solid #666}
td.testtd{border: 1px solid #666}
</style>
</head>

<body>

<h1>Note: You must add the first line "<!DOCTYPE ...>" or it will not work!</h1>


<table class="test" cellpadding="1">
 <tr class="testtr">
  <td class="testtd">one</td>
  <td class="testtd">two</td>
  <td class="testtd">three</td>
 </tr>
 <tr class="testtr">
  <td class="testtd">one</td>
  <td class="testtd">two</td>
  <td class="testtd">three</td>
 </tr>
</table>

</body>
</html>

No comments: