How to reduce table width when removing columns
How to reduce table width when removing columns

I'm using "colvis" in the Buttons extension.
There are many columns on my table. When I hiden a column using colvis, the availble space is reused and the table keeps its initial size.
Is there a way that the removing of a column will reduce the width of the table ?
Regards,
Answers
something like this could work: Changing the table width using CSS. $('.container') is the data table in this case. If you have it differently change that please.
Assuming that you want full-screen width when all columns are visible. columns.adjust and responsive.recalc are only to be used if you are using the responsive extension.
https://live.datatables.net/sulidoke/1/edit
Disable the
autoWidth
option and also make thetable
's widthauto
.Allan