I use this:
jQuery("tr:odd").css("background-color", "#f5f5f5"); jQuery("tr:even").css("background-color", "#ececec");
Just add the background color to the alternating rows of the table, which works great. The problem is that if there are several tables on one page, it simply repeats each table instead of resetting each table and starts a new one. My background color th the same color as my even lines. Therefore, in the end, it catches up, and I have th and tr that have the same color, so it looks like one big line.
How can I use these two jquery lines, but run it for each table on the page if there are multiple tables?
source share