Fixed Columns. move left
Fixed Columns. move left
https://www.lakeis.org/Stats_Scores_Winter.php
My datatable has 60 columns with the first 4 fixed. When I scroll left at the 31st column the left fixed columns move left. How do I prevent the movement and keep the columns fixed at all times.
NOTE: The top fixed columns do not move.
This question has an accepted answers - jump to answer
Answers
Looks like you are loading Bootstrap 3 but using the Datatables default styling includes.
Use the Download Builder to get the proper Datatables BS3 style integration files. See the Styling docs for more details.
Also note that you are loading jquery.js three times; once at line 37, then line 39 and in the concatenated Datatables .js and .css. jQuery should only be loaded once otherwise you may have operational issues with the .js compenents attaching to different jquery.js instances.
Try thse changes and let us know the results.
Kevin
It took me quite a while to figure out why I couldn't see a scroll bar on the page for the horizontal scroll. You have
height: 772px;on the firstdivelement in the page, chopping off the bottom of the page for me.You also have this on the table that I would very strongly suggest you remove:
display: blockfor the table is not supported by DataTables.Furthermore your HTML isn't valid HTML in that the colspan's don't line up. The first header row is two cells of 4 and 63 colspan, while the second header row is 4 and 62. Third header row appears to be 66 cells, while the table body rows have 67.
Correct those points and hopefully it should work.
Allan
Thank you Allen, removing the Style="" from the table corrected the problem.
Your comments are vry helpful.
Thank you.
Michael
Thank you for all the help. I made a lot of changes and all is working as expected.
Good stuff - thanks for letting me know.
Allan