我需要从 html 表的最后一列中删除边框线。我在表格的最后一个“列”(td) 上尝试了这个:
<td class="nobordercell">Comments</td>
.nobordercell {
border: none;
}
我也试过这个(border-collapse: collapse):
<table class="middletable" border="1">
<tr>
. . .
<td name="airfaredate1Comments" id="airfaredate1Comments" class="nobordercell">Comments</td>
</tr>
. . .
.middletable{
width:99%;
float:left;
border-collapse:collapse;
}
边框唯一消失的边缘是底部。我意识到这是因为仍然显示的边框属于表格,而不是 td,但仍然需要知道如何仅在 td 的边框与其相交的部分(或 如果显示 td 的边框,将相交)。
这是目前的样子:
...这就是我想要的样子:
最佳答案
您可以使用 :last-child 选择器:
table tr td:last-child {
border: none;
}
关于html - 如何从 HtmlTable 的一列和接触它的包含表的一部分中删除边框?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32191339/