Header misalignment - as the table scrolls to the right

Header misalignment - as the table scrolls to the right

antonyfergusonantonyferguson Posts: 1Questions: 1Answers: 0

We have a strange case with our data table. The first column is aligned correctly, and then as the columns move to the right, the alignment seems to go out.
I have attached a screenshot of the problem. I hope someone has already found a solution for this.
We have tried this {my_datatables_var}.columns.adjust(); and it has not worked.

Kind Regards

Answers

  • colincolin Posts: 15,112Questions: 1Answers: 2,583

    We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. 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

  • ioclaudioioclaudio Posts: 13Questions: 3Answers: 0
    edited May 2021

    Hi @antonyferguson I' have the same problem with the header of my table.
    I've seen that this solves the problem:

    table.dataTable tbody th,
    table.dataTable tbody td {
        white-space: nowrap;
    }
    

    But I have columns with long texts so I can't use the nowrap directive.
    Neither the command "table.colums.adjust()" in the initComplete function helps.
    I noted that if I click on the header then it settles.

    So I'm still looking for another solution, did you solve?

    Thank you

    cld

  • colincolin Posts: 15,112Questions: 1Answers: 2,583

    @ioclaudio If you can create a test case, we're happy to take a look. See details on how above,

    Colin

This discussion has been closed.