How to have Datatable adapt to changing width

How to have Datatable adapt to changing width

gaurav_balyangaurav_balyan Posts: 1Questions: 1Answers: 0

I have a table in which i have some data and have applied DataTable plugin sorting to it and it is working well, the layout of my page is that it is divided in two sections left bar(20%) and right bar(80%),left bar contains a collapse button and right side contains the actual table , what is happening is that initially my table renders fine as i have applied width on the header and body on the table and both header and body of the table is in sync and as soon as i click the collapse button which what it does is make the left bar width 1% and shift the right bar width 99%,but it make the header and the body misaligned to each other and they does not appear to be in sync , what i need is that when i click on the collapse button table adapts to the new width , how can i do that do i have to render the datatable gain but i dont want to lose any filter applied on the datatable, in short i want to take datatable and make it take the new width on header and body,

Answers

  • allanallan Posts: 63,799Questions: 1Answers: 10,514 Site admin

    Thanks for your question - however, per the forum rules can you link to a test case showing the issue please. This will allow the issue to be debugged.

    Information on how to create a test page, if you can't provide a link to your own page can be found here.

    Thanks,
    Allan

This discussion has been closed.