其实就是设置table的tr hover样式
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>表格隔行换色</title>
<style type="text/css">
.tables{
width:500px;
margin:auto;
border:1px solid #ccc;
border-collapse:collapse;
}
.tables th,tr,td{
border:1px solid #ccc;
}
.tables th{ background-color:#3FA7CB;}
.tables tr:hover{background-color:#FFCB99;}
</style>
</head>
<body>
<table class="tables">
<tr>
<th>ID</th>
<th>姓名</th>
<th>性别</th>
<th>备注</th>
</tr>
<tr>
<td>1</td>
<td>张三</td>
<td>男</td>
<td>没什么</td>
</tr>
<tr>
<td>2</td>
<td>lisa</td>
<td>女</td>
<td>洛杉矶</td>
</tr>
<tr>
<td>2</td>
<td>lisa</td>
<td>女</td>
<td>洛杉矶</td>
</tr>
</table>
</body>
</html>