您的位置:首页 > 其它

自己对“用不同颜色显示表格奇偶行的例子”扩充了用不同颜色显示鼠标单击的行 - 张孝祥专栏 - CSDNBlog

2007-11-20 12:21 671 查看
双色表格CSS实例

.test {
background-color:red;
}
#DataGrid1 tr {
background-color: expression(
this.sectionRowIndex == 0 ? "#FFCCCC" :
(
(this.sectionRowIndex % 2 == 0) ? "#FFF0F0" : "#F0F0FF"
)
);
color: expression(this.sectionRowIndex == 0 ? "#FFFFFF" : "");
font-weight: expression(this.sectionRowIndex == 0 ? "BOLD" : "");
RowSelect: expression(0==1?"":(
onclick = function()
{
window.currentRow?window.currentRow.style.backgroundColor=(
this.style.backgroundColor != "#69cdff" ? "#69cdff" :
(
this.sectionRowIndex == 0 ? "#FFCCCC" :
(
this.sectionRowIndex % 2 == 0 ? "#FFF0F0" : "#F0F0FF"
)
)
):"";
this.style.backgroundColor="#f3c3f3";
window.currentRow=this;
window.stopOut=true;
}
)
);
TableSelect: expression(
this.sectionRowIndex == 0 ? "" :
(
onmouseover = function()
{
window.stopOut=false;
this.style.backgroundColor =
(
this.style.backgroundColor != "#69cdff" ? "#69cdff" :
(
this.sectionRowIndex == 0 ? "#FFCCCC" :
(
this.sectionRowIndex % 2 == 0 ? "#FFF0F0" : "#F0F0FF"
)
)
)
},
onmouseout = function()
{
if(window.stopOut) return;
this.style.backgroundColor =
(
this.style.backgroundColor != "#69cdff" ? "#69cdff" :
(
this.sectionRowIndex == 0 ? "#FFCCCC" :
(
this.sectionRowIndex % 2 == 0 ? "#FFF0F0" : "#F0F0FF"
)
)
)
}
)
);
}

#DataGrid1 td {
background-color:expression(
this.cellIndex == 0 ?
(
this.parentElement.sectionRowIndex == 0 ? "#FFCCCC" : "#DDDDDD"
)
: null
)
}
.FindAreaTable1 {
font-size: 12px;
color: #333333;
text-decoration: none;
width: 400px;
cursor: hand;
background-color: #FFFFFF;
vertical-align: middle;
text-align: center;
}



首行首列首行首行首行首行首行
行1首列行1行1行1行1行1
行2首列行2行2行2行2行2
行3首列行3行3行3行3行3
行4首列行4行4行4行4行4
行5首列行5行5行5行5行5
本文转自
http://blog.csdn.net/zhangxiaoxiang/archive/2007/10/10/1819230.aspx
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐