我想为围绕表格和替代行颜色(灰色和白色)的元素创建一个类。第一行作为页眉样式(负),最后一行作为页脚。
现在我将第一行第一个单元格的左上角改为圆 Angular ,第一行最后一个单元格右上角也变成圆 Angular ...
这不是好的解决方案。谁能帮帮我?
最佳答案
使用当前样式,您的问题已解决:
<html>
<head>
<style>
table#t01 td{
padding:5px;
border: 1px gray solid;
}
table#t01 tr:nth-child(even) {
background-color: #eee;
}
table#t01 tr:nth-child(odd) {
background-color: #fff;
}
table#t01 tr:first-child td:first-child {
border-top-left-radius: 10px;
}
table#t01 tr:first-child td:last-child {
border-top-right-radius: 10px;
}
table#t01 tr:last-child td:first-child {
border-bottom-left-radius: 10px;
}
table#t01 tr:last-child td:last-child {
border-bottom-right-radius: 10px;
}
</style>
</head>
<body>
<table id="t01" cellspacing="0" align="center">
<tr>
<td>first row - first cell</td>
<td>first row - second cell</td>
<td>first row - third cell</td>
</tr>
<tr>
<td>second row - first cell</td>
<td>second row - second cell</td>
<td>second row - third cell</td>
</tr>
<tr>
<td>third row - first cell</td>
<td>third row - second cell</td>
<td>third row - third cell</td>
</tr>
<tr>
<td>forth row - first cell</td>
<td>forth row - second cell</td>
<td>forth row - third cell</td>
</tr>
<tr>
<td>fifth row - first cell</td>
<td>fifth row - second cell</td>
<td>fifth row - third cell</td>
</tr>
</table>
</body>
</html>
关于html - 创建圆形替代表 css 类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50554972/