<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<style>
.bc{
background-color:yellow ;
}
</style>
<script type="text/javascript" src="js/jquery.js" ></script>
<script>
$(function(){
$("tr:odd").addClass("bc");
$("tr:even").css("background","red");
})
</script>
<body>
<table align="center" width="50%" border="1px" cellspacing="0">
<tr>
<td>ID</td>
<td>NAME</td>
<td>AGE</td>
</tr>
<tr>
<td>001</td>
<td>张三</td>
<td>22</td>
</tr>
<tr>
<td>002</td>
<td>李四</td>
<td>21</td>
</tr>
<tr>
<td>003</td>
<td>王五</td>
<td>20</td>
</tr>
</table>
</body>
</html>