如何使用表体数据滚动固定表格标题? [英] How can I scroll the fixed table header with table body data?

查看:79
本文介绍了如何使用表体数据滚动固定表格标题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的表中有多列。我修复了表头工作正常。但是当我水平滚动表体柱时,头部不会随之移动。它只是修复了。如何解决这个问题。



我尝试过:



编辑小提琴 - JSFiddle [ ^ ]

I have multiple columns in my table. I have fixed the table header which is working fine. But when i scrolls the table body columns horizontally..header doesn't move with it. It just fixed. How to solve this issue.

What I have tried:

Edit fiddle - JSFiddle[^]

推荐答案

这个 [ ^ ]

应该工作

如果链接断开:

1.我已经修复了额外的

2.完全删除了js

3.样式是

This[^]
should work
In case link is broken:
1. I've fixed extra ""
2. Removed js completely
3. styles are
thead tr {
  display: block;
}

tbody {
  display: block;
  overflow: auto;
  height: 200px;
}


这篇关于如何使用表体数据滚动固定表格标题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆