My HTML table now has the scrolling function. Below, you can find the code snippet for the HTML table setup.
<div id="flagging" >
<table>
<thead>
<th> Header 1 </th>
<th> Header 2 </th>
</thead>
<tbody >
<tr>
<td> Row 1, Data 1</td>
<td>Row 1, Data 2</td>
</tr>
<tr>
<td> Row 2, Data 1</td>
<td>Row 2, Data 2</td>
</tr>
</tbody>
</table>
https://i.sstatic.net/NfoMy.png
The following code is specifically for enabling the scroll functionality on the table.
#flagging td,#flagging th{
padding: 2px;
text-align: center;
border: 1px solid #817e7e;
}
#flagging{
border: 1px solid #5a585a;
overflow: auto;
height: 150px;
}
Is there a way to make the header stay fixed while scrolling in this setup?