100分,答对全给.怎么让table的thead不随tbody滚动

hyee 2002-11-25 01:38:06
比如一个table有100行,那么怎么只让其内容(TBODY)滚动,不让其title(THEAD)滚动?
不能把一个TABLE拆开.因为随着内容的不同,就很可能不和TITLE对齐
...全文
170 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
swans 2002-11-26
  • 打赏
  • 举报
回复
以上的唯一注意的是,设置TD的 width为统一固定的大小。
swans 2002-11-26
  • 打赏
  • 举报
回复
存成html文件浏览看效果。
==============================

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>

<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="600" height="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="568" height="20" colspan="3"><table width="578" border="1">
<tr>
<td width="164">title</td>
<td width="206">title</td>
<td width="186">title</td>
</tr>
</table></td>
</tr>
<tr>
<td height="100%" valign="top"> <div style="overflow: auto;height:100%;">
<table width="578" border="1">
<tr>
<td width="165">fsdfds</td>
<td width="204">fsdffds</td>
<td width="187">sdfsdfdsf</td>
</tr>
<tr>
<td width="165">fsdfds</td>
<td width="204">fsdffds</td>
<td width="187">sdfsdfdsf</td>
</tr>
<tr>
<td width="165">fsdfds</td>
<td width="204">fsdffds</td>
<td width="187">sdfsdfdsf</td>
</tr>
<tr>
<td width="165">fsdfds</td>
<td width="204">fsdffds</td>
<td width="187">sdfsdfdsf</td>
</tr>
<tr>
<td width="165">fsdfds</td>
<td width="204">fsdffds</td>
<td width="187">sdfsdfdsf</td>
</tr>
<tr>
<td width="165">fsdfds</td>
<td width="204">fsdffds</td>
<td width="187">sdfsdfdsf</td>
</tr>
<tr>
<td width="165">fsdfds</td>
<td width="204">fsdffds</td>
<td width="187">sdfsdfdsf</td>
</tr>
<tr>
<td width="165">fsdfds</td>
<td width="204">fsdffds</td>
<td width="187">sdfsdfdsf</td>
</tr>
<tr>
<td width="165">fsdfds</td>
<td width="204">fsdffds</td>
<td width="187">sdfsdfdsf</td>
</tr>
<tr>
<td width="165">fsdfds</td>
<td width="204">fsdffds</td>
<td width="187">sdfsdfdsf</td>
</tr>
<tr>
<td width="165">fsdfds</td>
<td width="204">fsdffds</td>
<td width="187">sdfsdfdsf</td>
</tr>
<tr>
<td width="165">fsdfds</td>
<td width="204">fsdffds</td>
<td width="187">sdfsdfdsf</td>
</tr>
<tr>
<td width="165">fsdfds</td>
<td width="204">fsdffds</td>
<td width="187">sdfsdfdsf</td>
</tr>
<tr>
<td width="165">fsdfds</td>
<td width="204">fsdffds</td>
<td width="187">sdfsdfdsf</td>
</tr>
<tr>
<td width="165">fsdfds</td>
<td width="204">fsdffds</td>
<td width="187">sdfsdfdsf</td>
</tr>
<tr>
<td width="165">fsdfds</td>
<td width="204">fsdffds</td>
<td width="187">sdfsdfdsf</td>
</tr>
<tr>
<td width="165">fsdfds</td>
<td width="204">fsdffds</td>
<td width="187">sdfsdfdsf</td>
</tr>
<tr>
<td width="165">fsdfds</td>
<td width="204">fsdffds</td>
<td width="187">sdfsdfdsf</td>
</tr>
<tr>
<td width="165">fsdfds</td>
<td width="204">fsdffds</td>
<td width="187">sdfsdfdsf</td>
</tr>
<tr>
<td width="165">fsdfds</td>
<td width="204">fsdffds</td>
<td width="187">sdfsdfdsf</td>
</tr>
<tr>
<td width="165">fsdfds</td>
<td width="204">fsdffds</td>
<td width="187">sdfsdfdsf</td>
</tr>
<tr>
<td width="165">fsdfds</td>
<td width="204">fsdffds</td>
<td width="187">sdfsdfdsf</td>
</tr>
<tr>
<td width="165">fsdfds</td>
<td width="204">fsdffds</td>
<td width="187">sdfsdfdsf</td>
</tr>
<tr>
<td width="165">fsdfds</td>
<td width="204">fsdffds</td>
<td width="187">sdfsdfdsf</td>
</tr>
<tr>
<td width="165">fsdfds</td>
<td width="204">fsdffds</td>
<td width="187">sdfsdfdsf</td>
</tr>
<tr>
<td width="165">fsdfds</td>
<td width="204">fsdffds</td>
<td width="187">sdfsdfdsf</td>
</tr>
<tr>
<td width="165">fsdfds</td>
<td width="204">fsdffds</td>
<td width="187">sdfsdfdsf</td>
</tr>
<tr>
<td width="165">fsdfds</td>
<td width="204">fsdffds</td>
<td width="187">sdfsdfdsf</td>
</tr>
<tr>
<td width="165">fsdfds</td>
<td width="204">fsdffds</td>
<td width="187">sdfsdfdsf</td>
</tr>
<tr>
<td width="165">fsdfds</td>
<td width="204">fsdffds</td>
<td width="187">sdfsdfdsf</td>
</tr>
</table>
</div></td>
</tr>
</table>
</body>
</html>
方工 2002-11-26
  • 打赏
  • 举报
回复
HTML的表格没有您要求的功能。
不妨试试MS FlexGrid Control.
hyee 2002-11-26
  • 打赏
  • 举报
回复
如果你们说,哇噻!那你不会先定好么?如果一个表有比较多的列,
同时每行(row)不允许换行,那怎么办?如果给表的位置加滚动条,
那跟脚本一样,都不是最好的解决方法.因为有些列在一般情况下
分明都很短,但是也不是没有例外(我指的是asp等服务器端脚本生成的表)

有谁答对,给分!说话算话
hyee 2002-11-26
  • 打赏
  • 举报
回复
抱歉,各位,你们都没有答对,我说过不能把一个表拆成两个了.
因为,在实用的时候,有些表格的列的内容超出了您设定的长度,这是
很可能的.如果是一个文件列表,那么我不想当某一列超出范围之后自动换行,
那么应该怎么做呢?就是把一些没有设定长度长的列给撑小,这时候如果
thead部分和tbody不在同一个table里,table就会不齐.
你们都没有答对,0分!

难道非得用脚本强制定制么?:((
huangyq 2002-11-26
  • 打赏
  • 举报
回复
gz
禽兽v5 2002-11-25
  • 打赏
  • 举报
回复
也可以放入layer里面
bencalie 2002-11-25
  • 打赏
  • 举报
回复
TBODY放进iframe,只要你使用CSS把属性定位好,就不会出现不对齐的现象
禽兽v5 2002-11-25
  • 打赏
  • 举报
回复
贴一段你的原代码出来,我拿来试试
hyee 2002-11-25
  • 打赏
  • 举报
回复
哇噻,这么多高手每人吭气?

61,115

社区成员

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

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