简体   繁体   English

动态表格垂直和水平滚动粘性标题和固定列

[英]Dynamic Table Vertical & Horizontal scrolling sticky header and fixed column

I'm developing a solution that presents table like data to the user and the requirements are as follows:我正在开发一个解决方案,向用户呈现类似数据的表格,要求如下:

Horizontal scrolling within fixed dimensions.在固定尺寸内水平滚动。 As you scroll horizontally the first column must be sticky and follow the user as they scroll.当您水平滚动时,第一列必须具有粘性并在用户滚动时跟随用户。

Vertical scrolling with a sticky header as the user scrolls up or down they can always see the header.当用户向上或向下滚动时,带有粘性标题的垂直滚动他们总是可以看到标题。

Found one solution here: http://www.fixedheadertable.com/ which does what I want however, after implementing with my site the table changes width based on the window dimensions.在这里找到了一个解决方案: http : //www.fixedheadertable.com/做了我想要的,但是在我的网站上实现后,表格会根据窗口尺寸改变宽度。 This is not ideal.这并不理想。

I've posted multiple questions on here about this with no conclusive answers.我在这里发布了多个关于此的问题,但没有确定的答案。

Primarily asking if anyone knows of any plugins or done something similar to point me in the right direction.主要是询问是否有人知道任何插件或做过类似的事情来为我指明正确的方向。

Try SlickGrid: 试试SlickGrid:

SlickGrid is an advanced JavaScript grid. SlickGrid是高级JavaScript网格。 Some highlights: 一些重点:

  • Adaptive virtual scrolling (handle hundreds of thousands of rows with extreme responsiveness) 自适应虚拟滚动(以极高的响应速度处理数十万行)

  • Column resize/reorder/show/hide 列大小调整/重新排序/显示/隐藏

Apply exact width for each column. 为每列应用确切的宽度。 I hope the sticky header and table contents are in separate tables. 我希望粘性标题和表内容位于单独的表中。 So you have to specify width for header as well as table content separately. 因此,您必须分别为标题和表格内容指定宽度。 For example the first <td> of sticky header and first <td> of tabular data should have same width. 例如,第一<td>粘头和第一<td>表格数据应具有相同的宽度。 apply width like this for all columns. 对所有列应用这样的宽度。

Here I found the solution / exact functionality I was looking for . 在这里,我发现我一直在寻找解决方案/确切功能for

http://codepen.io/ourmaninamsterdam/full/jyBGz/ http://codepen.io/ourmaninamsterdam/full/jyBGz/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM