JSFiddle - React, Tailwind, and code Playground
by Rupam Datta
HTML
<table cellspacing="0" cellpadding="0" border="1" class="fixed-header">
<tr>
<th>Column1</th>
<th>Column2</th>
<th>Column3</th>
</tr>
</table>
<div class="container">
<table cellspacing="0" cellpadding="0" border="1">
<tr>
<th>Column1</th>
<th>Column2</th>
<th>Column3</th>
</tr>
<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>
<tr>
<td>Line11Cell1</td>
<td>Line11Cell2</td>
<td>Line11Cell3</td>
</tr>
<tr>
<td>Line12Cell1</td>
<td>Line12Cell2</td>
<td>Line12Cell3</td>
</tr>
<tr>
<td>Line13Cell1</td>
<td>Line13Cell2</td>
<td>Line13Cell3</td>
</tr>
<tr>
...
CSS
table {
}
table th,
table td {
padding: 10px;
width: 100px;
}
.fixed-header{
position: fixed;
background: #fff;
}
.container{
height: 402px;
overflow: auto;
}