I have a table with a first and a last row with background-color which I would like to have a space with their previous rows.
This is my code:
table {
border-collapse: collapse;
}
thead > tr > th {
font-size: 14px;
color: blue;
height: 44px;
vertical-align: middle;
text-align: left;
padding: 0 10px;
text-align: center;
border: none;
border-bottom: 1px solid blue;
position: relative;
}
thead > tr > th:after {
content: "";
position: absolute;
left: 100%;
top: 8px;
bottom: 8px;
width: 1px;
border-left: 1px dashed blue;
}
thead > tr > th:last-child::after {
border-left: none;
}
tbody > tr:first-child, tbody > tr:last-child {
background-color: gray;
}
tbody > tr:first-child > td, tbody > tr:last-child > td {
border-bottom: none;
color: black;
}
tbody > tr > td {
font-size: 12px;
line-height: 14px;
color: gray;
height: 44px;
vertical-align: middle;
padding: 8px 10px;
border: none;
border-bottom: 1px dashed gray;
position: relative;
}
tbody > tr > td:first-child {
color: black;
}
tbody > tr > td::after {
content: "";
position: absolute;
left: 100%;
top: 8px;
bottom: 8px;
width: 1px;
border-left: 1px dashed gray;
}
tbody > tr > td:last-child::after {
border-left: none;
}
<table>
<thead>
<tr>
<th>Column 1</th>
<th>Column 2</th>
<th>Column 3</th>
</tr>
</thead>
<tbody>
<tr>
<td>6546</td>
<td>5654</td>
<td>6454</td>
</tr>
<tr>
<td>6546</td>
<td>5654</td>
<td>6454</td>
</tr>
<tr>
<td>6546</td>
<td>5654</td>
<td>6454</td>
</tr>
<tr>
<td>6546</td>
<td>5654</td>
<td>6454</td>
</tr>
</tbody>
</table>
So I would like to have a white space between the blue border-bottom of the thead and the first gray row. Also between the last gray row and the previous dashed gray border-bottom. How can I do that?