我有桌子 tr设置有边框。我想从tr中删除最后一个td边框。下面是示例
<table>
<thead>
<tr>
<th>a</th>
<th>b</th>
<th>c</th>
<th>d</th>
</tr>
</thead>
<tbody>
<tr style="border-right: 1px solid #C1DAD7;border-bottom: 1px solid #C1DAD7;">
<td> adsd </td>
<td> adsd </td>
<td> adsd </td>
<td> adsd </td> <!-- I want to remove the border from this -->
</tr>
</tbody>
</table>
Run Code Online (Sandbox Code Playgroud)
任何答案将不胜感激
:last-child选择器允许您直接在包含元素内定位最后一个元素。在CSS选择器第3级规范中将其定义为“结构伪类”,这意味着它用于根据内容与父内容和同级内容的关系来设置内容的样式。
https://css-tricks.com/almanac/selectors/l/last-child/
table tr td:last-child{
border:0
}
Run Code Online (Sandbox Code Playgroud)