<table>
<tr class='r1'>....</tr>
<tr class='r2'>....</tr>
<tr class='r1'>....</tr>
<tr class='r2'>....</tr>
<tr class='r1'>....</tr>
</table>
.r1 { background-color:red}
.r2 { background-color:blue}
最简单普遍的做法,是对不一样的行设置不一样的CSS<table> <tr class='r1'>....</tr> <tr class='r2'>....</tr> <tr class='r1'>....</tr> <tr class='r2'>....</tr> <tr class='r1'>....</tr> .........</table>然后在样式表设置中对r1和r2设置不一样的背景色
.r1 { background-color:red}.r2 { background-color:blue}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)