我需要你的帮助,
以前在 IE7 中工作的是下面冻结 HTML 表格的顶行(标题):
#data tr th {
top: expression(this.offsetParent.scrollTop);
position: relative;
}
IE10似乎不再是这种情况。也就是说,如何修改我现有的编码,以便我能够像过去一样冻结表格的顶部标题行,哈哈
我在这里做了一个小提琴:http: //jsfiddle.net/8qq9Z/3/
这是 CSS 标记:
#data_container {
height: 160px;
border: 1px solid #808080;
scrollbar-base-color: #DFDFDF;
scrollbar-arrow-color: #235A81;
overflow-y: scroll;
overflow-x: scroll;
margin-top: 5px;
padding:0px;
position: relative;
}
#data {
color: rgb(11,63,113);
border: 0px;
width: 100%;
cursor: default;
table-layout: fixed;
margin:0px;
border:0px;
border-collapse:collapse;
}
#data th {
height: 18px;
cursor: pointer;
padding: 3px;
width: 140px;
border-top: none;
border-bottom: 1px solid rgb(128,128,128);
border-right: 1px solid rgb(128,128,128);
}
#data td {
padding: 3px;
border-right: 1px solid rgb(128,128,128);
border-bottom: 1px solid rgb(128,128,128);
}
#data th:hover {
text-decoration: underline;
}
#data tr th {
top: expression(this.offsetParent.scrollTop);
position: relative;
}
#data th:first-child {
border-left: 0;
}