Alternate row background color two rows at a time
Alternate row background color two rows at a time
nettunodev
Posts: 12Questions: 5Answers: 0
in DataTables
Hello,
I have a simple table and everything is working fine, alternating the background color of each row... except that I would like to alternate the background color every two rows instead.
Does anybody know how I can do that?
Thanks!
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Use the
stripeClasses
option to set a three row alternating class.Allan
Thanks, this is what I was looking for! Do you know if there is also a way to dynamically change this option? I mean, I would like to check a condition after the ajax call and set this option before the table is redrawn. Is there a way to do that?
Thanks again!
I do know (I'm the author of DataTables), and there isn't I'm afraid. You would need to make your Ajax call yourself and then set that option in the DataTables initialisation.
Allan
Hello, thanks again for your answers and for the amazing DataTables.