固定表头

1、采用  expression(IE6中可运行,会抖动,感觉不爽)
  <style>
        #FixedTitleRow
{
            position
: relative; 
            top
: expression(this.offsetParent.scrollTop); 
            z-index
: 10;
            background-color
: #E6ECF0;
        
}
        
        #FixedTitleColumn
{
            position
: relative; 
            left
: expression(this.parentElement.offsetParent.scrollLeft);
        
}
        
        #FixedDataColumn
{
            position
: relative;
            left
: expression(this.parentElement.offsetParent.parentElement.scrollLeft);
            background-color
: #E6ECF0;
        
}
    
</style>

2、判断浏览器类型(ie6中可以用,这个不会抖)
   <!--[if lt IE 7]>
   <style type="text/css">
    body{
    
overflow:hideden;
    }
   
#FixTitle{
    
position:absolute;
    }
   </style>
<![endif]-->

3、hack  (固定某容器在页面位置:ie7-firefox可以直接写 position:fixed,ie6 就不可以了)
#FixTitle
{
   
top:0px;
   
width:235px;
   
float:right;
   
position:fixed;
}
*html #FixTitle {
    position:absolute;
   
right:17px; /*only for ie*/
}
html {
   
overflow:auto; !important;
   
overflow:hideden;
}
posted on 2007-08-24 18:17  music000  阅读(612)  评论(0编辑  收藏  举报