DataTables logo DataTables

via Ad Packs
Header resizing
  • Hey,
    I've got a little issue when resizing my browser window.
    I've set dataTable header to 100% so both the header and content are set to 100% of the window, but when i am resizing,
    the header cells width are not being re-sized well to fit the content ones.
    but when i click on a header cell to "sort", it does organize it well to fit the header with the content cells.

    i've tried adding
             $(document).on('resize', function (event) {
                 DT.fnAdjustColumnSizing();
             });
    

    but it doesn't work, which method can i run on window re-size event to re-size the header cells to make it fit the content?
  • allanallan
    Posts: 15,883
    $(window).on('resize', function (event) {
        DT.fnAdjustColumnSizing();
    });
    

    Is typically what I use. If that doesn't work, please post a link to a test case showing the issue.

    Allan
This discussion has been closed.
← All Discussions

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Support

Get useful and friendly help straight from the source.

In this Discussion