I have a table which displays the data from a database. The <tr> and <td> are dynamically created using a for loop.
I want the data alone in that table to scroll with the <th> always visible so that user can see the headers while scrolling through the data.
are you using thead? i think this should work
.tbody{overflow:scroll; height:500px}
<thead>
<tr><th>head1</th>….</tr>
</thead>
<tbody>
<!– create <tr><td>h1r1</td></td> –>
</tbody>