I am striving to achieve a particular visual effect:
https://i.sstatic.net/xbuBq.png
The HTML code I am working with involves a basic table structure:
<table id="a">
<thead>
<tr>
<td>normal</td>
<td>grey</td>
<td>normal</td>
</tr>
</thead>
<tbody>
<tr>
<td>normal</td>
<td>grey</td>
<td>normal</td>
</tr>
<tr>
<td>normal</td>
<td>grey</td>
<td>normal</td>
</tr>
</tbody>
<tfoot>
<tr>
<td>normal</td>
<td>grey</td>
<td>normal</td>
</tr>
</tfoot>
</table>
To achieve rounded borders, I need to change the td
elements to display as inline-block
.
My challenge arises with the grey bands between rows. There are white spaces which I do not want. Unfortunately, I cannot use a separate background element because the number of rows may vary. edit: I require spacing between borders but wish for the white gaps in the grey column to be grey as well...
You can view my attempts here: https://jsfiddle.net/h5Lh1eaw/24/
Is there a solution using CSS that I am unaware of?