Columns custom width resetted after scroll down and up (with fixedHeader plugin)

Columns custom width resetted after scroll down and up (with fixedHeader plugin)

ManuDoniManuDoni Posts: 2Questions: 1Answers: 0

Hi,
I have a problem with custom width on <th>, using fixedHeader plugin.
If I set for example a th like this:

<th style="width:400px">Large column</th>

and I scroll down (until the fixed header appears) and up again, the width of the column will fit the content instead of being 400px.
This is the config:

{
    autoWidth: false,
    fixedHeader: true,
    responsive: true,
}

This is the fiddle:
http://live.datatables.net/dubefetu/1/edit?html,css,js,console,output

Thanks in advance

Answers

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

    Thanks for that test case, that really helped demonstrate the issue. I agree something looks wobbly there. I've raised it internally (DD-1415 for my reference) and we'll report back here when there's an update.

    Cheers,

    Colin

  • ManuDoniManuDoni Posts: 2Questions: 1Answers: 0
    edited May 2020

    Hello @colin , any news?
    I Noticed that this happens because the "real" <thead> gets recreated when the fixed header disappears (scrolling to the top).
    The regeneration of the thead lose the style attribute of the <th>.
    Is there a way, by api or config, to avoid the recreation of the thead?

This discussion has been closed.