Bootstrap 5 CSS not working when I use multiple tables on same page js => table.display
Bootstrap 5 CSS not working when I use multiple tables on same page js => table.display
Hi,
If I use the js $('table.display').DataTable({ as per https://datatables.net/examples/basic_init/multiple_tables.html with bootstrap CSS (https://datatables.net/examples/styling/bootstrap5.html) the styling gets messed up.
Is there a Bootstrap 5 CSS file available that I could use with $('table.display').DataTable?
Thanks
This discussion has been closed.
Answers
The
displayclass is a class used by the default Datatables styling. See this doc for details. If you are using Bootstrap you will want to use bootstrap 5 table classes. Click on the HTML tab of the example you linked for an example.Assuming you remove the
displayclass you will need to change your selector, ie,$('table.display'), to include all the desired tables.Kevin