I've a dynamic HTML page which has a table with multiple 'tbody' elements. Now, I'm stuck with CSS as I need to show a vertical bar inside each of the 'tbody' as shown in the image attached.
How could I get this done? I tried using 'tr::after' and creating a bar, but didn't help.
Here's my html:
Could you please help me achieve this?
<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>
In addition to @connor This does the trick:
Try giving the
:first-child
td
aborder-right
. If you're gonna have multiple columns, in stead of 2, try using:not(:last-child)
in stead of:first-child
.