Overriding tr.odd and tr.even depending on data
Overriding tr.odd and tr.even depending on data
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
This discussion has been closed.
Answers
Use
createdRowto 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 -
tabletag. If using the default Datatables styling remove thedisplaycalls 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