开发者

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

开发者 https://www.devze.com 2023-03-14 18:40 出处:网络
I am using this script to make my table headers stick to the top of the page when scrolling through the table:

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

精彩评论

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