table {
margin: auto auto;
border-collapse: separate;
border-spacing: 0;
}
col.empty {
border-width: 0;
width: 10px;
}
td,
th {
vertical-align: center;
text-align: center;
/* border: 1px solid black; */
margin: -10px;
}
.bd-0-0-0-0,
.bd-1-0-0-0,
.bd-0-1-0-0,
.bd-1-1-0-0,
.bd-0-0-1-0,
.bd-1-0-1-0,
.bd-0-1-1-0,
.bd-1-1-1-0,
.bd-0-0-0-1,
.bd-1-0-0-1,
.bd-0-1-0-1,
.bd-1-1-0-1,
.bd-0-0-1-1,
.bd-1-0-1-1,
.bd-0-1-1-1,
.bd-1-1-1-1 {
border: 0 solid black;
}
.bd-0-0-0-0 {
border-top-width: 0;
border-right-width: 0;
border-bottom-width: 0;
border-left-width: 0;
}
.bd-1-0-0-0 {
border-top-width: 1px;
border-right-width: 0;
border-bottom-width: 0;
border-left-width: 0;
}
.bd-0-1-0-0 {
border-top-width: 0;
border-right-width: 1px;
border-bottom-width: 0;
border-left-width: 0;
}
.bd-1-1-0-0 {
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 2;
border-left-width: 0;
}
.bd-0-0-1-0 {
border-top-width: 0;
border-right-width: 0;
border-bottom-width: 1px;
border-left-width: 0;
}
.bd-1-0-1-0 {
border-top-width: 1px;
border-right-width: 0;
border-bottom-width: 1px;
border-left-width: 0;
}
.bd-0-1-1-0 {
border-top-width: 0;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 0;
}
.bd-1-1-1-0 {
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 0;
}
.bd-0-0-0-1 {
border-top-width: 0;
border-right-width: 0;
border-bottom-width: 0;
border-left-width: 1px;
}
.bd-1-0-0-1 {
border-top-width: 1px;
border-right-width: 0;
border-bottom-width: 0;
border-left-width: 1px;
}
.bd-0-1-0-1 {
border-top-width: 0;
border-right-width: 1px;
border-bottom-width: 0;
border-left-width: 1px;
}
.bd-1-1-0-1 {
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 2;
border-left-width: 1px;
}
.bd-0-0-1-1 {
border-top-width: 0;
border-right-width: 0;
border-bottom-width: 1px;
border-left-width: 1px;
}
.bd-1-0-1-1 {
border-top-width: 1px;
border-right-width: 0;
border-bottom-width: 1px;
border-left-width: 1px;
}
.bd-0-1-1-1 {
border-top-width: 0;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
}
.bd-1-1-1-1 {
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
}
.test {
border-color: red;
border-width: 3px;
}
<table>
<cols>
<col>
<col class="empty">
<col>
<col>
<col class="empty">
<col>
<col>
</cols>
<thead>
<tr>
<th class="bd-1-1-1-1">Header 1</th>
<th class="bd-0-0-0-0"></th>
<th class="bd-1-1-0-1">Header 2</th>
<th class="bd-1-1-0-0">Header 3</th>
<th class="bd-0-0-0-0"></th>
<th class="bd-1-0-1-1">Header 4</th>
<th class="bd-1-1-1-1">Header 5</th>
</tr>
</thead>
<tbody>
<tr>
<td class="bd-0-1-1-1">Cell 1, 1</td>
<td class="bd-0-0-0-0" rowspan="4"></td>
<td class="bd-1-1-1-1 test" colspan="2">Cell 1, 3</td>
<td class="bd-0-0-0-0" rowspan="4"></td>
<td class="bd-0-0-0-1">Cell 1, 6</td>
<td class="bd-0-1-0-1">Cell 1, 7</td>
</tr>
<tr>
<td class="bd-0-1-1-1">Cell 2, 1</td>
<td class="bd-0-1-1-1">Cell 2, 3</td>
<td class="bd-0-1-1-0">Cell 2, 4</td>
<td class="bd-0-0-1-1 test">Cell 2, 6</td>
<td class="bd-1-1-1-1" rowspan="4">Cell 2, 7</td>
</tr>
<tr>
<td class="bd-0-1-1-1">Cell 3, 1</td>
<td class="bd-0-1-1-1" rowspan="2">Cell 3, 3</td>
<td class="bd-0-1-1-0">Cell 3, 4</td>
<td class="bd-0-0-1-1" rowspan="2">Cell 3, 6</td>
</tr>
<tr>
<td class="bd-0-1-1-1">Cell 4, 1</td>
</tr>
<tr>
<td class="bd-0-1-1-1">Cell 5, 1</td>
</tr>
</tbody>
</table>