开发者

Clone of table header doesn't inherit width when table is bigger than the window

I am using this script to make my table headers stick to the top of the page when scrolling through the table: http://cmcqueen1975.bitbucket.org/htmlFloatingTableHeader/tables.html

The problem is, when the table exceeds the window size, the table headers are still crammed in to 100% of the screen width. Then the headers don't line up with the cells th开发者_高级运维ey represent. This can be seen in this fiddle:

http://jsfiddle.net/UDNNr/


  1. The css-width of the cloned <tr/> doesn't match the sum of the width of the cells inside, you don't need to set the width of the <tr/>

  2. What you need is to set the table-layout-style of the table to "fixed"

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜