Set css on some odd/even class
Set css on some odd/even class
Hello,
I'm trying to set css background on row class "odd" and "even".
My problem: I have some rows with class "inactives" which souldn't be affected because they are not always displayed and have a specific css style.
My question is: Is this possible to set css on "odd" and "even" class but not the ones with "inactives" class?
The datatable can be reordered with different columns so I can't find a way to do this in javascript.
This question has an accepted answers - jump to answer
Answers
Not with the
odd
andeven
classes in DataTables. They treat all rows the same.How are you hiding the
inactives
rows?display: none
? If so, you might be able to use:nth-child(odd)
rather than the built in classes - although I'm not certain that would do it.Really the best way would be to not have rows in the table that you don't want to display.
Allan