SP自定义页面行颜色交替

来源:互联网 发布:美工培训班学费多少钱 编辑:程序博客网 时间:2024/05/29 17:29

script中添加行代码function () 中添加

var leg = detailbody.rows.length;

for (var i = 0; i < leg; i++) {

                if (i % 2 == 1) {
                    ts_tbody.style.backgroundColor = "#999";//偶数行时背景色为#999 
                }
                else {
                    detailbody.rows[i].style.backgroundColor = "White";//单数行时背景色为white  
                }
            }
原创粉丝点击