jQuery 制作带有固定标题和固定侧边栏的可滚动表格

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/15545317/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-26 15:17:47  来源:igfitidea点击:

Making a scrollable table with fixed header and fixed sidebar

jqueryhtmlcssfixed-header-tables

提问by riccardolardi

I need to always display the header and sidebar indexes, but let the content be scrollable freely x & y ... any solutions to this problem?

我需要始终显示标题和侧边栏索引,但让内容可以自由滚动 x & y ... 这个问题有什么解决方案吗?

I have looked at DataTables jQuery plugin (example: link), but I was wondering if there were any alternatives.

我看过 DataTables jQuery 插件(例如:链接),但我想知道是否有任何替代方案。

回答by Sahil Popli

You can put One thing Fixed

你可以把一件事固定

Header if horizontal scrolling

水平滚动时的标题

Demo : Horizontal scroll table

演示:水平滚动表

Sidebar If Vertical Scrolling

侧边栏如果垂直滚动

Demo : Fiddle with Vertical Scroll

演示:摆弄垂直滚动

or your [strange] case

或者你的[奇怪]案例

Demo: Both things fixed// Not recommended

演示:两件事都已修复// 不推荐



And what exactly you want is here

而你真正想要的就在这里

Demo : With Basic stylesLink is Broken Now Please Use this Instead

演示: 带有基本样式链接已损坏,请改用此链接

Source Code : snipt.org

源代码:snipt.org