Quantcast
Channel: IT社区推荐资讯 - ITIndex.net
Viewing all articles
Browse latest Browse all 11804

BIRT表格隔行添加颜色

$
0
0
选择table中的details,进入script页面, onprepare事件中声明   count = 0(注意不能有var);
2.oncreate时间中写:
count++;
if(count%2==0){
this.getStyle().backgroundColor = "#FFFFFF";
}else{
this.getStyle().backgroundColor = "#F5F5F5";
}

保存,刷新报表。
--------------------------------------------
鼠标悬浮改变背景颜色:
在table中添加一个header行,插入text,选择HTML,在编辑界面中写:
<div id="d1"></div>
<script>   
    var o = document.getElementById("d1");
    while(o != null){
        if (o.tagName == "TBODY")
            break;
        o = o.parentNode;
    }
    for (var i = 1; i < o.children.length; i++) {
        var ro = o.children[i];
        ro.onmouseover = function(){this.style.background="#CBF5FF";};
        ro.onmouseout = function(){ this.style.background="white";};
    }
</script>

设置背景颜色

已有 0人发表留言,猛击->> 这里<<-参与讨论


ITeye推荐




Viewing all articles
Browse latest Browse all 11804

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>