Fixed header with different row height than table

Fixed header with different row height than table

sunbathersunbather Posts: 8Questions: 4Answers: 0

Hello,

If I am not mistaken the issue has been already described in https://datatables.net/forums/discussion/10436/fixedheader-fixed-left-column-in-wrong-position-when-elements-are-different-heights but the links to reproduce the error now work correctly.
I have a very big table and either when I order it or resize the page fixed header behaves weirdly not copying the style of the underlying table.

I'm sorry for the quality of the screenshot but I am not a pro with image editing and there is a lot of sensitive data on it. As you can see the column on the left is the one where I applied fixed header, while the columns on the right (just two, the table is much wider) are not aligned with the header.
How can I fix it? I tried widening some cells since I thought that was caused by text data going on a new line, but that is not really the best way and didn't really fix the issue.

Thanks!

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599
    Answer ✓

    Hi @sunbather ,

    Unless you're using very old versions, that other thread wouldn't really help as the software has moved on loads since then.

    We're happy to take a look, but it would help, as per the forum rules, if you could link to a running test case showing the issue so we can offer some help. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

  • sunbathersunbather Posts: 8Questions: 4Answers: 0

    Hello @colin
    Unfortunately the project is running under a VPN, I would have to write a manual test case to show the issue but I doubt I have time to do so, I will try to edit this message if I am able to. From how I analyzed the problem, the issue is the following:

    • Some rows are higher than others because of their content
    • At the very beginning, when you load the table, fixedHeader works perfectly fine: it draws the header with the correct heights
    • The moment you click on top of one of the orderable columns, the table correctly sorts the results
    • The issue is that fixedHeader is not able to redraw itself to match the height of the higher row(s) resulting in the shown issue: the row(s) with a different height are moved around and while fixedHeader correctly displays the data in the header according to the row(s), its height does not change accordingly
  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Hi @sunbather ,

    Nothing obvious jumps out. As I said though, a test case is really needed so we can diagnose. We also don't have time to create test cases that then may not match what you're doing...

    Cheers,

    Colin

This discussion has been closed.