body,table, td, a {font:9pt;}
/*重点:固定行头样式*/
.scrollRowThead{
position: relative;
left: expression(this.parentElement.parentElement.parentElement.parentElement.scrollLeft);
z-index:0;}
/*重点:固定表头样式*/
/*行列交叉的地方*/
.scrollCR { z-index:3;}
/*div外框*/
.scrollDiv {
height:200px;
clear: both;
border: 1px solid #EEEEEE;
OVERFLOW: scroll;width: 300px; }
/*行头居中*/
.scrollColThead td,.scrollColThead th
{ text-align: center ;}
/*行头列头背景*/
.scrollRowThead,.scrollColThead td,.scrollColThead th
{background-color:#FFFFFF;}
/*表格的线*/
.scrolltable{
border-bottom:1px solid #CCCCCC;
border-right:1px solid #CCCCCC; }
/*单元格的线等*/
.scrolltable td,.scrollTable th{
border-left: 1px solid #CCCCCC;
border-top: 1px solid #CCCCCC;
padding: 5px; }
thead tr{
position: relative;
top: expression(this.parentElement.parentElement.parentElement.scrollTop);
z-index:3;
background-color:#CCCCCC;
}
-->
利用CSS代码让Table产生固定表头
www.865171.cn
//要用JS在后面追加
h1
h2
h3
h4
h5
a
单元格2
单元格3
单元格4
单元格5
b
单元格2
单元格3
单元格4
单元格5
c
单元格2
单元格3
单元格4
单元格5
d
单元格2
单元格3
单元格4
单元格5
e
单元格2
单元格3
单元格4
单元格5
f
单元格2
单元格3
单元格4
单元格5
g
单元格2
单元格3
单元格4
单元格5
查看更多关于求大神帮忙解决,一个用JS追加页面css元素(div或span)问题_html/css_WEB-IT的详细内容...
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://haodehen.cn/did104909