【发布时间】:2018-03-17 05:57:28
【问题描述】:
我有一个动态 HTML 页面,其中有一个包含多个“tbody”元素的表格。 现在,我坚持使用 CSS,因为我需要在每个“tbody”内显示一个垂直条,如附图所示。
我怎样才能做到这一点?我尝试使用 'tr::after' 并创建一个栏,但没有帮助。
这是我的html:
你能帮我实现这个吗?
<table>
<tbody class="container">
<tr>
<td>Row 1 Column 1</td>
<td>Row 1 Column 2</td>
</tr>
<tr>
<td>Row 2 Column 1</td>
<td>Row 2 Column 2</td>
</tr>
<tr>
<td>Row 3</td>
</tr>
</tbody>
<tbody class="container">
<tr>
<td>Row 1 Column 1</td>
<td>Row 1 Column 2</td>
</tr>
<tr>
<td>Row 2 Column 1</td>
<td>Row 2 Column 2</td>
</tr>
<tr>
<td>Row 3</td>
</tr>
</tbody>
<tbody class="container">
<tr>
<td>Row 1 Column 1</td>
<td>Row 1 Column 2</td>
</tr>
<tr>
<td>Row 2 Column 1</td>
<td>Row 2 Column 2</td>
</tr>
<tr>
<td>Row 3</td>
</tr>
</tbody>
</table>
【问题讨论】:
-
请粘贴您尝试过的CSS。?
标签: html css html-table pseudo-element