I use this CSS code to display a database output in rows where the colors repeat in every 2nd row
tbody tr:nth-child(2n) td, tbody tr.even td { backgro
I like the answer above, but alternate row colours doesn't seem to work if a document isn't refreshed.
Try jQuery too:
$("tbody tr:even td").css("background-color", "lightgray");
Link: http://docs.jquery.com/Tutorials:Zebra_Striping_Made_Easy