gpt4 book ai didi

html - 如何从 HtmlTable 的一列和接触它的包含表的一部分中删除边框?

转载 作者:太空宇宙 更新时间:2023-11-03 21:26:51 25 4
gpt4 key购买 nike

我需要从 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 的边框,将相交)。

这是目前的样子:

enter image description here

...这就是我想要的样子:

enter image description here

最佳答案

您可以使用 :last-child 选择器:

table tr td:last-child {
border: none;
}

http://www.w3schools.com/cssref/sel_last-child.asp

关于html - 如何从 HtmlTable 的一列和接触它的包含表的一部分中删除边框?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32191339/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com