<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>隔行变色</title>
<style type="text/css">
table{ border:0;border-collapse:collapse;}
td{ font:normal 12px/17px Arial;padding:2px;width:100px;}
th{ font:bold 12px/17px Arial;text-align:left;padding:4px;border-bottom:1px solid #333;}
.even{ background:#FFF38F;}
.odd{ background:#FFFFEEE;}
</style>
</head>
<body>
<table>
<thead>
<tr><th>姓名</th><th>性别</th><th><暂住地址></th></tr>
</thead>
<thody>
<tr><td>张三</td><td>男</td><td>北京海淀</td></tr>
<tr><td>李四</td><td>女</td><td>北京昌平</td></tr>
<tr><td>小刚</td><td>男</td><td>北京朝阳</td></tr>
<tr><td>小盼</td><td>女</td><td>北京东城</td></tr>
</thody>
</table>
<script src="js/jquery-1.12.4.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
$("tr:odd").addClass("odd");
$("tr:even").addClass("even");
});
</script>
</body>
</html>