Columns not aligned when first 2 rows fixed

Columns not aligned when first 2 rows fixed

exdelieriumexdelierium Posts: 5Questions: 1Answers: 0

Link to test case:
https://membra.de/public/1/test
https://membra.de/public/1/test?noHeadline=1

Description of problem:
Hi, I use a fixed header for my datatables and it mostly works perfectly (https://membra.de/public/1/test?noHeadline=1). Just when I have a second headline row that I want to be fixed (https://membra.de/public/1/test), the columns are not perfectly aligned in the bottom part of the table (i.e. all rows but the first two rows). With each column to the right, the missalignment grows by about a pixel.
As I cannot find the reason for this, maybe one of you can give me some pointers where to search for the reason and how to fix this.
Thank you in advance
Alex

This question has accepted answers - jump to:

Answers

  • exdelieriumexdelierium Posts: 5Questions: 1Answers: 0

    Additional Info:
    - It does not matter if or how many columns are fixed on the left.
    - I checked the CSS for different paddings of the cells, as the "scrollable" is realised by printing two full tables and just showing a part of each, so I thought it might have something to do with the wrapping DIVs and SPANs, but I could not find any differing CSS Styling in the top and bottom table.

  • exdelieriumexdelierium Posts: 5Questions: 1Answers: 0

    I have come this far:
    the bottom toable seems to be correct, whereas the top table has the following issues: the cells have style="width:44px", but the actual width (firebug) is 44.2px. As I cannot find any styling thats the reason for this, I assume it is because the width of the whole table is miscalculated and a bit wider than supposed to be, and those extra pixels are then evenly distributed to the cells with 0.2px each.

    The big question is: why is the top table made 8 pixels wider than would be correct?

    I guess one has to fully understand how it is calculated by datatables, and thats where I am stuck... :-/

    Every pointer is appreciated
    Alex

  • exdelieriumexdelierium Posts: 5Questions: 1Answers: 0

    Hi, I really need a fix for this. Is there maybe a way to buy some kind of professional support without buying a whole support package?

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

    It looks like you're using an old version of everything. DataTables is 1.10.13 and FixedColumn is 3.2.2; the latest versions are 2.0.3 and 5.0.0 respectively. I'd suggest updating those first of all and see if that resolves the issue. There have been significant improvements in both that should help.

    Colin

  • exdelieriumexdelierium Posts: 5Questions: 1Answers: 0

    Hi Colin, thank you for your input. Unfortunately, we have a lot of individual code for our datatables, which seem to not really work with the new versions. According to the principle "never change a winning team", we concluded to keep the running system as is. Except for this minor styling error, everything works perfectly :-)

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Answer ✓

    I've just tried it with your HTML with the latest versions (test case here) and it does appear to work with the latest changes.

    The column alignment is probably the most difficult part of DataTables, and as Colin says, there have been a lot of changes since the versions you are using.

    I'm afraid it isn't possible for me to support versions of the software from 8 years ago, when the new versions don't have the issue.

    If there was an easy fix, I'd let you know, but I don't believe there is - it is all about how the column width calculations are made and then applied.

    You could try updating to DataTables 1.13.11 (legacy download builder here) and see if that helps, but that is no longer being updated (unless some security issue were to come up).

    Allan

Sign In or Register to comment.