用 th 原因
th       {   
                background-color:       #ffff82;   
                position:       relative;   
                top:       expression(document.getElementById(   "divTableContainer   ").scrollTop);   
                z-index:       10; 
                font-weight:normal;   
}   
不是吧 这个例子 是你找来的?

解决方案 »

  1.   

    你没有设置 th 是表头
    表头多重要啊 默认加粗一下 合情合理
    font-weight:normal;  
    加这个才是把它属性改变了
      

  2.   

    锁定算啥啊
    起作用的是你的expression 脚本
    跟文字样式无关
    th,td{font:````,color:``````等}
      

  3.   

    th               {       
                                    background-color:               #ffff82;       
                                    position:               relative;       
                                    top:               expression(document.getElementById(       "divTableContainer       ").scrollTop);       
                                    z-index:               10;   
                                    font-weight:normal;       
    }      这样写的话,字体是调过来了,但table不能锁定了? 
      

  4.   

    顺便再给你贴一个
    <html> 
      <head> 
      <title> 行列锁定 </title> 
    <style type="text/css"> 
    table { 
        border: #a4cdf2 1px solid; 

    th { 
        border: #a4cdf2 1px solid; 
        font-family:  "courier new"; 
        font-size: 11pt; 
        background-color: #ffff82; 
        position: relative; 
        top: expression(document.getElementById("divTableContainer").scrollTop); 
        z-index: 10; 
    font-weight:normal;
        

    th.lock { 
        border: #a4cdf2 1px solid; 
        font-family:  "courier new"; 
        font-size: 11pt; 
        background-color: #ffff82; 
        position: relative; 
        top: expression(document.getElementById("divTableContainer").scrollTop); 
        left: expression(document.getElementById("divTableContainer").scrollLeft); 
        z-index: 11; 

    td.locked { 
        position: relative; 
        left: expression(document.getElementById("divTableContainer").scrollLeft); 
        background-color: #ffff82; 

    td { 
        border: #a4cdf2 1px solid; 
        font-family:  "courier new"; 
        font-size: 11pt; 
    }   </style> 
      </head>   <body> 
      <div id="divTableContainer" style="width: 298px; overflow: auto;"> 
        <table cellpadding="0" cellspacing="0" id="tabTarget">       
          <tr> 
            <th nowrap class="lock"> Column A </th> 
            <th nowrap> Column B </th> 
            <th nowrap> Column C </th> 
            <th nowrap> Column D </th> 
            <th nowrap> Column E </th> 
          </tr> 
          <tr> 
            <td class="locked"> R1.1 </td> 
            <td> R1.2 </td> 
            <td> R1.3 </td> 
            <td> R1.4 </td> 
            <td> R1.5 </td> 
          </tr> 
          <tr> 
            <td class="locked"> R2.1 </td> 
            <td> R2.2 </td> 
            <td> R2.3 </td> 
            <td> R2.4 </td> 
            <td> R2.5 </td> 
          </tr> 
          <tr> 
            <td class="locked"> R3.1 </td> 
            <td> R3.2 </td> 
            <td> R3.3 </td> 
            <td> R3.4 </td> 
            <td> R3.5 </td> 
          </tr> 
        </table> 
      </div> 
      </body> </html> 目前的效果是上下滚动正常,左右滚动时Column A单元格被盖掉了,只需解决这个问题即可!请各位帮忙