How to make sticky columns
How to make sticky columns
Hello,
I need to implement a table with many columns. The table is too wide and the container element can't accommodate the entire table. Users use horizontal scroll bar to see all the content. I want the first two columns to be sticky (fixed at their position regardless the scroll bar), the scroll bar only scroll other columns.
Could you share your idea of above problem? Thank you in advance.
Ken
I need to implement a table with many columns. The table is too wide and the container element can't accommodate the entire table. Users use horizontal scroll bar to see all the content. I want the first two columns to be sticky (fixed at their position regardless the scroll bar), the scroll bar only scroll other columns.
Could you share your idea of above problem? Thank you in advance.
Ken
This discussion has been closed.
Replies
Patrick
http://datatables.net/plug-ins/
http://datatables.net/release-datatables/extras/FixedHeader/top_bottom_left_right.html (for example)
But it won't fix two columns in place at the moment. I believe the code is flexible enough to be expanded to do this, although it might be a little tricky in places :-)
Allan
The FixedHeader demo places fixed-position left and right column on the page. It only works for tables which occupy the whole screen. Does it also work for non-full-screen tables?
In addition, the demo's left and right column is row number but not actual column data. In my case, I want the left column to be a real column data, and it should reorder along with other columns while sorting.
What direction should I go if I need to expand FixedHeader to implement above features?
Thanks.
Ken
As for how to expand FixedHeader - I'd suggest looking at the code to understand how it fixes the left hand column to start with - the expansion is simply to add an additional column to that.
Allan