JSFiddle - React, Tailwind, and code Playground
HTML
<div class="outerDIV">
<div class="innerDIV">
<table border="1">
<thead>
<tr>
<div>
<th>Column1</th>
<th>Column2</th>
<th>Column3</th>
</div>
</tr>
</thead>
<tbody>
<tr>
<td>Line1Cell1</td>
<td>Line1Cell2</td>
<td>Line1Cell3</td>
</tr>
<tr>
<td>Line2Cell1</td>
<td>Line2Cell2</td>
<td>Line2Cell3</td>
</tr>
<tr>
<td>Line3Cell1</td>
<td>Line3Cell2</td>
<td>Line3Cell3</td>
</tr>
<tr>
<td>Line4Cell1</td>
<td>Line4Cell2</td>
<td>Line4Cell3</td>
</tr>
<tr>
<td>Line5Cell1</td>
<td>Line5Cell2</td>
<td>Line5Cell3</td>
</tr>
<tr>
<td>Line6Cell1</td>
<td>Line6Cell2</td>
<td>Line6Cell3</td>
</tr>
<tr>
<td>Line7Cell1</td>
<td>Line7Cell2</td>
<td>Line7Cell3</td>
</tr>
<tr>
<td>Line8Cell1</td>
<td>Line8Cell2</td>
<td>Line8Cell3</td>
</tr>
<tr>
<td>Line9Cell1</td>
<td>Line9Cell2</td>
<td>Line9Cell3</td>
</tr>
<tr>
<td>Line10Cell1</td>
<td>Line10Cell2</td>
<td>Line10Cell3</td>
</tr>
...
CSS
.outerDIV {
position: relative;
padding-top: 30px;
}
.innerDIV {
overflow: auto;
max-height: 250px;
}
table thead {
border: 1px solid #000;
display: block;
padding: 2px;
position: absolute;
top: 0;
left: 0;
}
table tbody {
display: block;
}
th,
td {
width: 100px;
}