Rumah > Artikel > hujung hadapan web > Css基本样式――――综合设计:表格的制作_html/css_WEB-ITnose
<table id="tb"> <tr> <th>姓名</th> <th>年龄</th> <th>性别</th> </tr> <tr> <td>小王</td> <td>20</td> <td>男</td> </tr> <tr class="alt"> <td>小王</td> <td>20</td> <td>男</td> </tr> <tr> <td>小王</td> <td>20</td> <td>男</td> </tr> <tr class="alt"> <td>小王</td> <td>20</td> <td>男</td> </tr></table>#tb{ border-collapse: collapse; width: 500px;}#tb td,#tb th{ border: 1px solid bisque; padding: 5px;}#tb th{ text-align: left; background-color: aqua; color: #ffffff;}#tb tr.alt td{ color: black; background-color: aquamarine;}