DataTable width increases on every columns.adjust() call

Viewed 59

I just noticed that every time I call $('#my_table').DataTable().columns.adjust() the width of the table increases by 2-3 pixeles.

Firstly, does anyone else see this happening? And secondly, how to avoid it or make the table to resize itself back to the container width?

1 Answers

Maybe there are more robust solutions, but I solved this simply by setting the width of the table to be the same as the parent element.

$('#my_table').DataTable().columns.adjust()
$('#my_table').width($('#my_table_wrapper').width())
Related