DataTables TH classes
DataTables TH classes
I was applying a class to the <th> element using Bootstrap markup. Example: <th class="text-center">. However, it appears DT destroys any classes upon initialization.
I came up with a workaround that appears to work, but I was curious to see if it would have any negative impacts down the road.
What I ended up doing is using a data tag in the TH markup such as <th data-format="text-center">.
In my script I use $("[data-format='text-center']").addClass('text-center'); and it appears to work....Any downside to this?
Replies
Sure, same solution as this thread