87,907
社区成员
发帖
与我相关
我的任务
分享
首先定义一个style
<style>
.tabletop {
margin-top: 20px;//这个功能是让你的表格和表头顶部对齐
}
</style>
<body>//这个就是主体了,思路是上面表头下面表格
<aside style="position:fixed; left:0; top:0; width:100%; height:40;">
<table width="98%" align="center" bgcolor="#CCCCCC">
<tr>
这样就是定义一条高度为四十的固定表头,注意下面你的表格里面需要class="tabletop"
</tr>
</table>
</aside>
<TABLE class="tabletop">
你的表格,具体表格内容
</TABLE>
</body>
position:fixed;
top:30px;//固定上边距
left:5px;//固定左边距
注意:要添加背景色,否则,往下拉的时候,会显示下面行的东西,不好看。