Set css on some odd/even class

Set css on some odd/even class

krizenkrizen Posts: 6Questions: 2Answers: 0

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

  • allanallan Posts: 63,852Questions: 1Answers: 10,519 Site admin
    Answer ✓

    Not with the odd and even 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

This discussion has been closed.