0
I have an item listing table with groups of lines (tbody) and would like to add spacing between them, not that I haven’t already done, but I’ve been looking for a "less gambiarra" way to achieve the feat.
I would also like to style the edges of the table better while I get the spacing. Here’s an example from the table:
Example
table { text-align:left; border-collapse:separate; border-spacing:0; }
table tbody { border-spacing:0 10px; } /* apenas ilustrativo */
table tbody td { vertical-align:middle; border-top:1px solid #000; }
table tbody:nth-child(odd) { background-color:#ccc; }
<table>
<thead>
<tr>
<th>#</th>
<th>th1</th>
<th>th2</th>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="2">1</td>
<td>Teste</td>
<td>Lorem Ipsum</td>
</tr>
<tr>
<td colspan="2">Algum conteúdo</td>
</tr>
</tbody>
<tbody>
<tr>
<td rowspan="2">2</td>
<td>Teste</td>
<td>Lorem Ipsum</td>
</tr>
<tr>
<td colspan="2">Algum conteúdo</td>
</tr>
</tbody>
</table>
For those who have never seen a table with multiple <tbody>, there goes a good request: https://www.w3.org/WAI/tutorials/tables/irregular/
Interesting, it works, however the structure of columns of the table is lost,
tbody
looks like the first left column in the table.– Machado