你如何防止红色轮廓被绿色背景颜色隐藏th
并保持border-collapse
?是否有定义此行为的 CSS 规范?
table {
border-collapse: collapse
}
tbody {
outline: solid red;
}
thead tr th {
background-color: green;
position: sticky;
top: 0
}
<table>
<thead>
<tr><th>header</th></tr>
</thead>
<tbody>
<tr><td>content</td></tr>
</tbody>
</table>