本来是在百度上搜索隔行换颜色的 结果 看到了这种写法:
tab1.find("tr:even").css("background-color", "white");//even 就是 查找表格的1、3、5...行(即索引值0、2、4...)
tab1.find("tr:odd").css("background-color", "#8dd2fb");//odd 查找表格的2、4、6行(即索引值1、3、5...)
以前还没见过这种写法!
本来是在百度上搜索隔行换颜色的 结果 看到了这种写法:
tab1.find("tr:even").css("background-color", "white");//even 就是 查找表格的1、3、5...行(即索引值0、2、4...)
tab1.find("tr:odd").css("background-color", "#8dd2fb");//odd 查找表格的2、4、6行(即索引值1、3、5...)
以前还没见过这种写法!