css为tbody或者li奇数偶数行样式
<style> table tbody tr:nth-child(odd){ background:#fff; } table tbody tr:nth-child(even){ background:#F5F5F5; } </style <table> <thead> <th>序号</th> <th>姓名</th> <th>性别</th> </thead> <tbody> <tr> <td>1</td> <td>张三</td> <td>男</td> </tr> <tr> <td>1</td> <td>李四</td> <td>男</td> </tr> </tbody> </table
亦心晗