DataTables header and body misalignment issue when scrollX or scrollY is used

DataTables header and body misalignment issue when scrollX or scrollY is used

LuthfaLuthfa Posts: 3Questions: 1Answers: 0
edited June 2018 in Free community support

Below is my table definition. I have also tried to adjust columns by table.columns.adjust().draw(); But with no luck. Please help.

$('#table').DataTable({
        "scrollY": 350,
        "scrollX": "100%",
        "scrollCollapse": true,
        "scroller": true,
        "autoWidth": false
    });

This question has an accepted answers - jump to answer

Answers

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

    Hi @Luthfa ,

    The problem is because you've disabled autoWidth, which stops the column width handling. If you leave that enabled, as in this example (with all your settings present), it works as expected.

    Cheers,

    Colin

  • LuthfaLuthfa Posts: 3Questions: 1Answers: 0
    edited June 2018

    Hi @colin Even If I leave autoWidth as enabled then also I am getting misalignment between header and body.
    Please suggest any other solution

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

    Hi @Luthfa ,

    We're happy to take a look, but the best thing to progress this would be for you to provide a link to your page or to modify my example to demonstrate the problem.

    Cheers,

    Colin

  • LuthfaLuthfa Posts: 3Questions: 1Answers: 0

    This is fixed now. Added fixed width for image column.

This discussion has been closed.