如何修改 CSS 编码,以使第一行(顶部标题)被冻结?
代码需要符合 IE7 标准。
table.dataTable {
margin: 0;
padding: 0;
border-bottom: 1px solid #999;
border-left: 1px solid #999;
color: #235A81;
font-family: Arial;
font-size: 9pt;
}
table.dataTable th {
margin: 0;
border-right: 1px solid #999;
border-top: 1px solid #999;
font-weight: normal;
padding: 4px 3px 3px 4px;
background: #ccc;
font-weight: bold;
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#ffffff", endColorstr="#cdcdcd");
text-align: left;
width: 150px;
}
table.dataTable td {
margin: 0;
border-right: 1px solid #999;
border-top: 1px solid #999;
padding: 2px 3px 3px 4px
}
div.scrollTableContainer {
height: 285px;
overflow: auto;
width: 900px;
margin: 15px 0 0 0;
position: relative;
}
div.scrollTableContainer table {
width: 952px;
}
div.scrollTableContainer td:last-child {padding-right: 20px;}
div.scrollTableContainer tr:first-child td { border-top: 0; }
div.scrollTableContainer thead th {border-bottom: 1px solid #999; }
这是一个工作小提琴:http: //jsfiddle.net/Uamhc/