当前位置:我的异常网» JavaScript » 怎么将table的前几行几列锁定,其他部分自由滚动
怎么将table的前几行几列锁定,其他部分自由滚动
www.myexceptions.net 网友分享于:2013-02-25 浏览:252次
如何将table的前几行几列锁定,其他部分自由滚动?
如题,另外最好可以控制一下锁定行列的外观以示区别
------解决方案--------------------
原来在 IE 6 下面试验过可以,
不过刚才 IE 7 下发现效果不对了,IE 7 越修麻烦越多了!
楼主如果用 IE 6 看看效果对不?俺用 IE 7,效果一塌糊涂了,哈
lock columntable {
border: #a4cdf2 1px solid;
}
th {
border: #a4cdf2 1px solid;
font-family: "courier new ";
font-size: 11pt;
background-color: #ffff82;
position: relative;
top: expression(document.getElementById( "divTableContainer ").scrollTop);
z-index: 10;
}
td.locked {
position: relative;
left: expression(document.getElementById( "divTableContainer ").scrollLeft + "px ");
background-color: #ffff82;
}
td {
border: #a4cdf2 1px solid;
font-family: "courier new ";
font-size: 11pt;
}
Column A | Column B | Column C | Column D | Column E |
---|---|---|---|---|
R1.1 | R1.2 | R1.3 | R1.4 | R1.5 |
R2.1 | R2.2 | R2.3 | R2.4 | R2.5 |
R3.1 | R3.2 | R3.3 | R3.4 | R3.5 |
文章评论