We would like to know how to change table cell background color when hover.
<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
tr {<!--from ww w .j a v a2 s . c o m-->
color: #222;
background-color: #f0f0f0;
}
tr:hover {
color: #fff;
background-color: #0080ff;
}
</style>
</head>
<body>
<table>
<tr>
<td>Sample</td>
<td>Text</td>
</tr>
</table>
</body>
</html>
The code above is rendered as follows: