两个放在不同的td中不就OK ?

解决方案 »

  1.   

    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>表头不动</title>
    <style>
    .fixedHeaderTr 

    position:relative; 
    top:expression(this.offsetParent.scrollTop); 
    }; .mainDiv 

    overflow:auto; 
    scrollbar-face-color:9999ff;
    height:expression((document.body.clientHeight-this.offsetTop-20>this.children[0].offsetHeight)?(this.children[0].offsetHeight+20) : (document.body.clientHeight-this.offsetTop-20)); 
    width:expression(document.body.clientWidth-20); 
    }
    </style>
    </head> <body>
      <div class="mainDiv">
         <table width="100%" border=1 cellspacing=0 style="margin-top:-2px" >
         <TR class="fixedHeaderTr" style="background:navy;color:white;">
         <TD nowrap>Header A</TD>
         <TD nowrap>Header B</TD>
         <TD nowrap>Header C</TD>
         </TR>
         <TR>
         <TD>A</TD>
         <TD>B</TD>
         <TD>C</TD>
         </TR>
         <TR>
         <TD>A</TD>
         <TD>B</TD>
         <TD>C</TD>
         </TR>
         <TR>
         <TD>A</TD>
         <TD>B</TD>
         <TD>C</TD>
         </TR>
         <TR>
         <TD>A</TD>
         <TD>B</TD>
         <TD>C</TD>
         </TR>
         <TR>
         <TD>A</TD>
         <TD>B</TD>
         <TD>C</TD>
         </TR>
         <TR>
         <TD>A</TD>
         <TD>B</TD>
         <TD>C</TD>
         </TR>
         <TR>
         <TD>A</TD>
         <TD>B</TD>
         <TD>C</TD>
         </TR>
         </table>
      </div>
     </body>
    </html>