For this particular scenario, specific colors are assigned using classes such as gradeA
, gradeB
, gradeC
, and so on. It's uncertain whether these classes were dynamically generated or if jQuery Theme Roller was utilized. The assumption is that the styles were generated using theme roller. To apply custom classes to your table, simply utilize the custom classes options.
Check out more here:
https://datatables.net/styling/custom_classes
From there, you can implement something like this:
oTable = $('#example').dataTable( {
"aoColumns" : [
{ sClass: "myCustomClass" }
]});
-plus-
table.display tr.even.myCustomClass { background-color: #ffdddd; }
table.display tr.odd.myCustomClass { background-color: #ffeeee; }
A similar question can be found here:
Giving custom classes to each TD for styling - Datatables & jQuery
Additionally, take a look at this one involving filters:
datatables add class to filters