网页中隔行变色的table表格实现
<head>
<title>网页中隔行变色的table表格实现</title>
<style>
<!--
tr{
background: #333;
}
tr:nth-child(2n){
background: #ccc;
}
tr{
background-color: expression((this.sectionRowIndex % 2 == 0) ? "#333" : "#ccc" );
}
-->
</style>
</head>
<body>
<table>
<tr><td>111111111</td></tr>
<tr><td>222222222</td></tr>
<tr><td>333333333</td></tr>
<tr><td>444444444</td></tr>
</table>
</body>
</html>
发表评论