如何使用HTML跳过第一行的第一个单元格,同时在表格的其余部分保持表格边框(如图片中的示例)?我知道如何对单个单元格边框执行此操作,但我希望保留表的外部边框,而不是单元格边框。例如,有没有办法从第二列开始第一行?
发布于 2021-04-24 21:30:35
您需要为每个单元格设置边框,而不是在表格上全局设置边框。
代码可能如下所示
table {
border: none;
}
table tr:first-child td {
border-top: 1px solid black;
}
table tr:last-child td {
border-bottom: 1px solid black;
}
/* ... same for columns with pseudo classes on td */
/* first cell in first row */
table tr:first-child td:first-child {
border: 1px solid black;
border-left-color: transparent;
border-top-color: transparent;
}
我让你自己弄清楚细节
https://stackoverflow.com/questions/67243066
复制相似问题