I'm trying to create a 2D table with fixed variables on the top and far left of the table. I have already added the horizontal and vertical headers, but I'm not too sure of how to fix them so that the viewer can scroll through the data.
CSS + HTML:
.fixed-tables {
position: relative background: white;
}
.fixed-tables th {
position: absolute;
background: white;
}
<table class="table fixed-tables">
<thead>
<tr>
<th></th>
<th>Hor. Header 1</th>
<th>Hor. Header 2</th>
<th>Hor. Header 3</th>
</tr>
</thead>
<tbody>
<tr>
<th>Ver. Header 1</th>
<td>(null)</td>
<td>(null)</td>
</tr>
<tr>
<th>Ver. Header 2</th>
<td>(null)</td>
<td>(null)</td>
</tr>
<tr>
<th>Ver. Header 3</th>
<td>(null)</td>
<td>(null)</td>
<td>(null)</td>
</tr>
</tbody>
</table>
This doesn't quite work because the data and headers overlap one another. Any advice is greatly appreciated.