Having trouble assigning a specific class name to individual columns in datatables? It seems that when columns are hidden using the responsive extension, the desired class is not applied. Looking for a solution or workaround.
Check out this example from Datatables:
https://datatables.net/extensions/responsive/examples/display-control/init-classes.html
The visible salary
column has a class of desktop
$('.desktop').length;
12
The hidden extn
column has a class of none
$('.none').length;
0
Edit:
Seems like there's been an ongoing issue since 2016 regarding this matter.
https://github.com/DataTables/Responsive/issues/93
Any suggestions for workarounds would be greatly appreciated.
Take a look at this jsfiddle for a visual demonstration of the problem.
When the display size is reduced horizontally, the salary
column disappears. Upon expanding it again, notice how the yellow color of the column is lost.