怎么固定表格的一部分

rongwenfeng 2003-11-24 05:00:27
就是一个表格中有好多数据,第一条是表头,表很长也很宽,我怎么才能移动左右滚动条的时候,左边的两个格不动,只后面的动,移动上下滚动条的时候,表头不动,只有下面的动呢???
...全文
467 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
rongwenfeng 2003-11-26
  • 打赏
  • 举报
回复
寻求最佳解决办法,最好不用FRAME
zlm18691859 2003-11-25
  • 打赏
  • 举报
回复
如果可以,给分吧! 还有更好的!

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>滚动条的表格--层技术</title>


</head>

<body>
<div id="Layer1" style="position:absolute; left:330px; top:49px; width:353px; height:170px; z-index:1; visibility: visible;">
<table width="300" border="1" align="center" cellpadding="0" cellspacing="0">
<tr bgcolor="#99CCFF">
<th width="43" height="27">标题</th>
<th width="54">标题</th>
<th width="63">标题</th>
<th width="62">标题</th>
<th width="66">标题</th>
</tr>
<tr>
<th width="43" height="26" bgcolor="#99CCFF">标题</th>
<td height="105" colspan="4" rowspan="4" valign="top" bgcolor="#FFFFCC"><div id="Layer2" style="position:absolute; left:73px; top:27px; width:252px; height:105px; z-index:2; overflow: scroll;">
<table width="400" height="218" border="1" cellpadding="0" cellspacing="0">
<tr>
<td width="14%" height="27" valign="top">内容</td>
<td width="18%" valign="top">内容</td>
<td width="18%" valign="top">内容</td>
<td width="17%" valign="top">内容</td>
<td width="15%" valign="top">内容</td>
<td width="18%" valign="top">内容</td>
</tr>
<tr>
<td height="25" valign="top">内容</td>
<td width="18%" valign="top">内容</td>
<td width="18%" valign="top">内容</td>
<td width="17%" valign="top">内容</td>
<td width="15%" valign="top">内容</td>
<td width="18%" valign="top">内容</td>
</tr>
<tr>
<td height="32" valign="top">内容</td>
<td width="18%" valign="top">内容</td>
<td width="18%" valign="top">内容</td>
<td width="17%" valign="top">内容</td>
<td width="15%" valign="top">内容</td>
<td width="18%" valign="top">内容</td>
</tr>
<tr>
<td height="31" valign="top">内容</td>
<td width="18%" valign="top">内容</td>
<td width="18%" valign="top">内容</td>
<td width="17%" valign="top">内容</td>
<td width="15%" valign="top">内容</td>
<td width="18%" valign="top">内容</td>
</tr>
<tr>
<td height="27" valign="top">内容</td>
<td valign="top">内容</td>
<td valign="top">内容</td>
<td valign="top">内容</td>
<td valign="top">内容</td>
<td valign="top">内容</td>
</tr>
<tr>
<td height="29" valign="top">内容</td>
<td valign="top">内容</td>
<td valign="top">内容</td>
<td valign="top">内容</td>
<td valign="top">内容</td>
<td valign="top">内容</td>
</tr>
<tr>
<td height="27" valign="top">内容</td>
<td valign="top">内容</td>
<td valign="top">内容</td>
<td valign="top">内容</td>
<td valign="top">内容</td>
<td valign="top">内容</td>
</tr>
<tr>
<td valign="top">内容</td>
<td valign="top">内容</td>
<td valign="top">内容</td>
<td valign="top">内容</td>
<td valign="top">内容</td>
<td valign="top">内容</td>
</tr>
</table>
</div>
</td>
</tr>
<tr>
<th height="26" bgcolor="#99CCFF">标题</th>
</tr>
<tr>
<th height="26" bgcolor="#99CCFF">标题</th>
</tr>
<tr>
<th height="27" bgcolor="#99CCFF">标题</th>
</tr>
</table>
</div>
</body>
</html>
rongwenfeng 2003-11-25
  • 打赏
  • 举报
回复
TO zlm18691859():
我要的是第一行的标题在向右移动的时候它也跟着移动
happylifei 2003-11-25
  • 打赏
  • 举报
回复
问:更菜的问题:上面的好多代码,是直接写代码,还是通过DW生成的呢?

如果通过DW生成的话,怎么加入div的呢

谢谢各位高手
wanghr100 2003-11-25
  • 打赏
  • 举报
回复
http://expert.csdn.net/expert/topic/2484/2484929.xml?temp=.3282

//最近这问题问得好多啊。。
stefli 2003-11-24
  • 打赏
  • 举报
回复
要么就使用 iframe了。
netyvon 2003-11-24
  • 打赏
  • 举报
回复
我也不会,还请楼上高人明示:)
hrong 2003-11-24
  • 打赏
  • 举报
回复
表格里套表格: 再加上这个: <div style="overflow: auto; width: 100%; height: 100%">

61,125

社区成员

发帖
与我相关
我的任务
社区描述
层叠样式表(英文全称:Cascading Style Sheets)是一种用来表现HTML(标准通用标记语言的一个应用)或XML(标准通用标记语言的一个子集)等文件样式的计算机语言。
社区管理员
  • HTML(CSS)社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧