欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  web前端

CSS实现表头固定的可滚动表格的浏览器兼容问题_html/css_WEB-ITnose

程序员文章站 2022-05-11 13:37:07
...
我想作一个表头固定、表身可滚动的表格。从网上搜来一个例子如下:

http://www.imaputz.com/cssStuff/bigFourVersion.html
http://*.com/questions/13043837/scrollable-table-with-fixed-header

经过调整,在Firefox、Chrome和IE10下好用,但在IE8、IE9和IE11里不好用。症状是tboytboy部分不能滚动(没有滚动条)。表格外边的container可以有滚动条,但表头会和表身一起滚动。

请问有没有好办法解决这浏览器一兼容问题?谢谢!

(从明天起休假一周,回来后结账)

Untitled Document

Pure CSS Scrollable Table with Fixed Header

Using CSS to allow scrolling within a single HTML table



Header 1 Header 2 Header 3
Cell Content 1 1 Cell Content 1 2 Cell Content 1 3
Cell Content 2 1 Cell Content 2 2 Cell Content 2 3
Cell Content 3 1 Cell Content 3 2 Cell Content 3 3
Cell Content 4 1 Cell Content 4 2 Cell Content 4 3
Cell Content 5 1 Cell Content 5 2 Cell Content 5 3
Cell Content 6 1 Cell Content 6 2 Cell Content 6 3
Cell Content 7 1 Cell Content 7 2 Cell Content 7 3
Cell Content 8 1 Cell Content 8 2 Cell Content 8 3
Cell Content 9 1 Cell Content 9 2 Cell Content 9 3
Cell Content 10 1 Cell Content 10 2 Cell Content 10 3
Cell Content 11 1 Cell Content 11 2 Cell Content 11 3
Cell Content 12 1 Cell Content 12 2 Cell Content 12 3
Cell Content 13 1 Cell Content 13 2 Cell Content 13 3
Cell Content 14 1 Cell Content 14 2 Cell Content 14 3
Cell Content 15 1 Cell Content 15 2 Cell Content 15 3

回复讨论(解决方案)

没人回复。是问题太难了,还是我的人品太差?

完全复制表
一张在下面滚动
一张外面包个div 只显示表头 叠在上面

多谢KK3K2005热心回复!

用两个同样的表?能说得再详细一点吗?我用在ASP.NET网页中。