Fixed first row
Fixed first row

I have a table with scrollY where i would like to also fix the first row (which will always be the same) when scrolling. Is this possible?
What i'm trying to accomplish is for a user to be able to compare rows 2+ with the first row while scrolling, so i don't need the first row be an actual row, if that makes it easier for me to do what i want but i would like to have the row look as much like the rest of the rows as possible.
Thanks
This question has an accepted answers - jump to answer
Answers
You can use the Absolute Sorting plugin for that - here's an example of it.
Colin
I need the top row to be fixed when i have scrollY set to something (400 in my case). Your example doesn't seem to handle that?
Or do i just not understand your answer?
I edited your example to replicate my table/what i want: http://live.datatables.net/qujunigu/1/edit
In that exmaple i would want the new extra row (test) to be fixed when scrolling
I would look at creating a second table header then place the data for that row in that header.
Kevin
@kthorngren as in creating a second header inside my current table or a completely new table? And i guess that would leave me with an extra header with column titles and everything?
Something like this maybe?
http://live.datatables.net/qujunigu/1/edit
Kevin
I don't see any changes between yours and mine - are you sure you posted the right link?
Strange it didn't automatically save:
http://live.datatables.net/qujunigu/2/edit
Note the use of
orderCellsTop
to move the sorting to the top header row. It also usestable().header()
.Kevin
That worked perfectly. Thank you so much for the quick and very helpful response!