开发者

Static Html Table Header Code

开发者 https://www.devze.com 2023-04-02 05:19 出处:网络
I want to have the headers of this html table fixed, so as I scroll down and the headers remain static.

I want to have the headers of this html table fixed, so as I scroll down and the headers remain static.

My table header HTML:

<table style="width: 425px; height: 4810px;" border="0">
<tbody>
<tr class="tableizer-firstrow">
<th colspan="3">
<div style="text-align: left; text-color: #00A599;"><span style="color: #00a599;">SEPTEMBER 2011 Anniversaries</span></div>
&l开发者_开发问答t;/th>
</tr>
<tr>
<th class="style1" style="text-align: center" width="143">Employee</th><th style="text-align: center" width="137">Department</th><th style="text-align: center" width="92">DOH</th><th width="49">Years</th>
</tr>
<tr>


Guessing from your question that you want fixed headers?

Take a look at the jQuery Scrollable Table Plugin if you can use jQuery in your solution.


You could separate the table from the header and have 2 tables, 1 with just the heading. Then for the content table you could put it in a DIV, and use CSS to make it scrollable.

http://jsfiddle.net/cm3Wu/

However you would have to manually assign widths to the TD elements since the header is split.

0

精彩评论

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