issue in multirow headers with fixed header

issue in multirow headers with fixed header

babarDevbabarDev Posts: 6Questions: 2Answers: 0

Hello DataTables Team,

I am encountering an issue with column width alignment when using a fixed header in combination with a multi-row header setup. The problem arises when I have a header row with a column that has a colspan,

When the header is fixed, DataTables automatically distributes the second-header-row column widths equally. In my case, since "Aircraft" has colspan=3, DataTables divides the width of that header into 3 equal parts (33.3% each), instead of adjusting the widths based on the actual content or column widths in the table body.

The second-row headers should match the actual column widths in the table body, rather than being split evenly.
The alignment between the header and table body should remain consistent, even when scrolling.

can you please provide me the fix?

https://live.datatables.net/lehopuza/8/edit

here is the DataTable: https://live.datatables.net/lehopuza/8/edit

This question has an accepted answers - jump to answer

Answers

  • babarDevbabarDev Posts: 6Questions: 2Answers: 0

    please let me know if there is any fix.

  • burbur Posts: 30Questions: 2Answers: 2
    Answer ✓

    You can use CSS instead of the fixedHeader property: https://live.datatables.net/lehopuza/9/

  • babarDevbabarDev Posts: 6Questions: 2Answers: 0
    edited March 23

    Thanks, bur, but there are issues when I use CSS then I am not able to use fixedColumns: {
    leftColumns: 2
    },

    I am hoping Datatable have some fixes

  • allanallan Posts: 64,210Questions: 1Answers: 10,597 Site admin

    Thanks for the test case - there does indeed appear to be an issue there. I'll look into it and let you know as soon as I've had a chance to do so.

    Allan

Sign In or Register to comment.