1.tableFixHead { overflow: auto; height: 100px; }
2.tableFixHead thead th { position: sticky; top: 0; z-index: 1; }
3
4/* Just common table stuff. Really. */
5table { border-collapse: collapse; width: 100%; }
6th, td { padding: 8px 16px; }
7th { background:#eee; }
1table tbody { display:block; max-height:450px; overflow-y:scroll; }
2table thead, table tbody tr { display:table; width:100%; table-layout:fixed; }
3
1<div class="tableFixHead">
2 <table>
3 <thead>
4 <tr><th>TH 1</th><th>TH 2</th></tr>
5 </thead>
6 <tbody>
7 <tr><td>A1</td><td>A2</td></tr>
8 <tr><td>B1</td><td>B2</td></tr>
9 <tr><td>C1</td><td>C2</td></tr>
10 <tr><td>D1</td><td>D2</td></tr>
11 <tr><td>E1</td><td>E2</td></tr>
12 </tbody>
13 </table>
14</div>