<style> *{ margin: 0; padding: 0; } body{ padding: 200px; box-sizing: border-box; } table{ border-collapse: collapse; } td,th{ color: #000; font-size: 16px; line-height: 30px; border: 1px solid #333; padding: 0 15px; box-sizing: border-box; } tbody tr:nth-child(odd){ background: rgba(204,255,255,.6); } </style>
<table> <thead> <tr> <th>懒猪</th> <th>懒猪</th> <th>懒猪</th> <th>懒猪</th> <th>懒猪</th> <th>懒猪</th> </tr> </thead> <tbody> <tr> <td>鹏仔先生</td> <td>鹏仔先生</td> <td>鹏仔先生</td> <td>鹏仔先生</td> <td>鹏仔先生</td> <td>鹏仔先生</td> </tr> <tr> <td>鹏仔先生</td> <td>鹏仔先生</td> <td>鹏仔先生</td> <td>鹏仔先生</td> <td>鹏仔先生</td> <td>鹏仔先生</td> </tr> <tr> <td>鹏仔先生</td> <td>鹏仔先生</td> <td>鹏仔先生</td> <td>鹏仔先生</td> <td>鹏仔先生</td> <td>鹏仔先生</td> </tr> <tr> <td>鹏仔先生</td> <td>鹏仔先生</td> <td>鹏仔先生</td> <td>鹏仔先生</td> <td>鹏仔先生</td> <td>鹏仔先生</td> </tr> <tr> <td>鹏仔先生</td> <td>鹏仔先生</td> <td>鹏仔先生</td> <td>鹏仔先生</td> <td>鹏仔先生</td> <td>鹏仔先生</td> </tr> </tbody> </table>
tbody tr:nth-child(odd){ background: #f7f8f9; }
table tr:nth-child(even){ background: #f7f8f9; }
table{ border-collapse: collapse; }
css 结构性伪类选择器 https://www.lmcjl.com/post/119.html
本文链接:http://so.lmcjl.com/news/401/