是否有可能在表格行中添加边框,而不是像<td>
那样为单个单元格提供边框,
<table cellpadding="0" cellspacing="0" width="100%" style="border: 1px;" rules="none">
<tbody>
<tr>
<th style="width: 96px;">Column 1</th>
<th style="width: 96px;">Column 2</th>
<th style="width: 96px;">Column 3</th>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td style="border-left: thin solid; border-top: thin solid; border-bottom: thin solid;"> </td>
<td style="border-top: thin solid; border-bottom: thin solid;"> </td>
<td style="border-top: thin solid; border-bottom: thin solid; border-right: thin solid;"> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
</tbody>
</table>
这在给定的<tr>
周围提供了一个边框,但它需要在单个单元格周围设置一个边框。
我们可以一次性给<tr>
一个边框吗?
发布于 2014-01-02 03:17:17
发布于 2014-01-02 03:28:28
使用CSS类:
tr.border{
outline: thin solid;
}
并像这样使用它:
<tr class="border">...</tr>
发布于 2019-11-22 23:44:40
您可以在tr元素上使用box-shadow属性作为边框的替代。另外,同一元素上的任何边界半径属性也将应用于长方体阴影。
box-shadow: 0px 0px 0px 1px rgb(0, 0, 0);
https://stackoverflow.com/questions/20872200
复制相似问题