React+MUI样式组件实现表格仅首行与第二行、页脚间加间距
问题
我尝试结合使用cell spacing与border-collapse,但间距会应用到整个表格。我只想在表格首行与第二行之间、以及页脚处添加间距。当前使用React的MUI样式组件开发,曾尝试用两个表格实现需求,但不符合代码规范;也试过border-spacing、border-collapse等多种CSS规则。
期望实现的表格样式

当前示例代码
HTML
<table class="tableClass"> <thead> <tr> <th>header 1</th> <th>header 2</th> <th>header 3</th> <th>header 4</th> <th>header 5</th> </tr> </thead> <tbody> <td>content 1</td> <td>content 2</td> <td>content 3</td> <td>content 4</td> <td>content 5</td> </tbody> </table>
CSS
.tableClass{ border-collapse: separate; border-spacing: 10px 0px;}
更新(解决方案)
保留空单元格并应用empty-cell: hide规则可实现所需效果。感谢帮助,也为表述不清致歉。
内容的提问来源于stack exchange,提问作者GeekDev
相关产品推荐
相关产品推荐

