日期:2014-05-18  浏览次数:20446 次

table表头固定
<div   runat= "server "   id= 'MainDiv '   style= 'overflow:auto;top:40px;left:10px; '   class= 'coolScrollBar '>
<table   runat= "server "     border= '1 '     id   = "MainTable "   style= "font-size:9pt;table-layout:fixed "   bordercolor= '#000000 '   cellpadding= '2 '   cellspacing= '0 '     borderColorDark= '#ffffff '     borderColorLight= '#003042 '   onkeydown= "InputGrid_SetKeyDown() ">
  <tr   class= " ">
        <td   style= "width:31px "   align= "center " > 序号 </td>
  </tr>
</table>
</div>

请问这个第一行怎么做到表头固定

------解决方案--------------------
表头固定有两种方式,添加样式,以及直接写脚本控制.
对表头的行添加样式,可参看
http://tech.tom.com/1380/1384/2004225-83576.html



------解决方案--------------------
把width定死不行么?
------解决方案--------------------
接分
------解决方案--------------------
1
------解决方案--------------------
2
------解决方案--------------------
3
------解决方案--------------------
直接设置width不可以吗?
------解决方案--------------------
这贴有水帖的嫌疑#89
------解决方案--------------------
http://topic.csdn.net/t/20050517/13/4013253.html
------解决方案--------------------
把表头和表的主体部分分开,把表的主体放到DIV里就可以了.