开发者

Scrollable Table Keeping the headers always visible

开发者 https://www.devze.com 2023-03-06 12:59 出处:网络
I have a table which displays the data from a database. The <tr> and <td> a开发者_如何学编程re dynamically created using a for loop.

I have a table which displays the data from a database. The <tr> and <td> a开发者_如何学编程re 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>

0

精彩评论

暂无评论...
验证码 换一张
取 消