HTML/jQuery Tables: Scroll horizontally, fix the first (left) column

為{幸葍}努か 提交于 2019-12-05 08:27:45

I managed to make the first column fixed, have the others slide under, and have the second column show: http://jsfiddle.net/Skooljester/trFPD/1/ I'll try working on the other parts of your question now.

Figured out something that works with tables, as I asked. What I said before about creating one fixed table and one scrollable table works with some modification:

I kept my original table with test names and data, and put it into a scrolling window. Then I created another table that only had the left column and placed it absolutely over the default position of the left column in the scrolling table. I then use jQuery to resize the single column cells to match the variable heights of the data cells (if the name cells are taller, the data cells still receive this data from the duplicated column).

I also keep an array of column widths. When I click on the left or right scroll button, I scroll the table over by the required array value, and increment/decrement the array index.

Not posting code because I don't want to rewrite and format an example, but if you have questions about how to do this, feel free to ask. =)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!