I am attempting to create a table layout with spacing between cells but without any external space for the cells at the border. I have written a simple code snippet to illustrate my issue:
html, body, div,
table, caption, tbody, tfoot, thead, tr, th, td{
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
.whatiwant {
width: 80px;
height: 110px;
border: 1px solid blue;
position:absolute;
left: 10px;
top: 10px;
}
table {
border: 1px solid red;
border-spacing: 10px;
border-collapse: separate;
}
td{
width: 20px;
height: 20px;
background-color: #000;
}
<div class="whatiwant"></div>
<table>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
</table>
My goal is to achieve a table layout like the one outlined in blue. Does anyone have insight on how to accomplish this using just CSS?