使用jquery则只需要
$(function(){ $(‘#tbStu tr:nth-child(even)‘).addClass(‘trOdd‘); })
复习 table表格
可选属性 border 规定表格边框的宽度
cellpadding 规定单元边沿与其内容之间的空白
cellspaceing 规定单元格之间的空白
js实现表格隔行变色--与jQuery的对比
原文:https://www.cnblogs.com/pittle-z/p/10012851.html