Overriding tr.odd and tr.even depending on data
Overriding tr.odd and tr.even depending on data
veloopity
Posts: 87Questions: 36Answers: 2
My customer wants the standard alternating <tr> background color to be overridden depending on data. Specifically, data rows older than 2024 should be colored differently (also alternating like even and odd but using different colors). Is there a way to achieve that?
This question has an accepted answers - jump to answer
Answers
Use
createdRow
to apply styles to the rows based on a condition. See this example.You can remove the table striping by removing the appropriate striping class from the -
table
tag. If using the default Datatables styling remove thedisplay
calls and add the appropriate styling classes. See the Default styling options for details.Kevin
cool, thank you. This finally helped me get it going:
https://live.datatables.net/tohehohe/1/edit