Add classes to elements (bs5)
Add classes to elements (bs5)

Using jQuery, I have added the bootstrap class 'pagination-sm' after the table, to make it smaller.
$('ul.pagination').addClass('pagination-sm');
however, it is getting removed again when ever the table changes (e.g. gets filtered). Must be simple way around this?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
use the "draw" event to add the class. So that it gets added whenever the table is drawn or redrawn.
https://datatables.net/reference/event/draw
Thanks again rf1234, that has done the trick. I've used this code: