jquery隔行变色代码

 方法1:

$("tr").each(function(i){this.style.backgroundColor=['#ccc','#fff'][i%2]}) //实现表格的隔行换色效果

方法2:

 $("tr:even").addClass("alt");    //给表格的偶数行添加class值为alt   

原文地址:https://www.cnblogs.com/QiuJL/p/4524232.html