0
如何修改CSS編碼,使第一行(頂部標題)被凍結?凍結html表格中的頂部標題行
代碼需要符合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/
可能重複[HTML表與固定標頭?](http://stackoverflow.com/questions/673153/html-table-with-fixed-headers) – AndreKR
可能重複[HTML表與固定標頭? ](https://stackoverflow.com/questions/673153/html-table-with-fixed-headers) –