高手赐教实现table自动折行

孙小雄 2006-10-25 05:50:04
把每个table中放入一个图片,让他们按照窗体的宽度,尽可能的显示,当改变窗体大小时候,能够实现图片的自动折行
...全文
261 4 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
孙小雄 2006-10-26
  • 打赏
  • 举报
回复
前面说的不好,我再说一遍:

我们知道,把一群图片放在一个宽度等于屏幕宽度的(width=100%)的TABLE的TD当中,
当图片的总共宽度超过了表格的宽度,这些图片会动态的自动换行。我们很喜欢这种效果。
因为它类似Windows 资源管理器。
----------------------------------------------------------------------------------
<table width="100%" height="100%" border="1" cellpadding="0" cellspacing="0">
<tr>
<td>
<img src="http://www.google.com/intl/zh-CN_ALL/images/logo.gif" width="286" height="110" />
<img src="http://www.google.com/intl/zh-CN_ALL/images/logo.gif" width="286" height="110" />
<img src="http://www.google.com/intl/zh-CN_ALL/images/logo.gif" width="286" height="110" />
<img src="http://www.google.com/intl/zh-CN_ALL/images/logo.gif" width="286" height="110" />
<img src="http://www.google.com/intl/zh-CN_ALL/images/logo.gif" width="286" height="110" />
<img src="http://www.google.com/intl/zh-CN_ALL/images/logo.gif" width="286" height="110" />
<img src="http://www.google.com/intl/zh-CN_ALL/images/logo.gif" width="286" height="110" />
</td>
</tr>
</table>

----------------------------------------------------------------------------------



这时我们在给个图片的外围套上一个表格,这种情况就不再存在了,每个带着表格的图片不再横排排列,而是单独一行,即时用了nowrap 、<nobr>的标签依然无效, 那么我们的问题就是 如何让表格实现并排排列,自动折行呢?

----------------------------------------------------------------------------------

<table width="100%" height="100%" border="1" cellpadding="0" cellspacing="0">
<tr>
<td nowrap="nowrap">
<table width="286" height="110"><tr><td><img src="http://www.google.com/intl/zh-CN_ALL/images/logo.gif" width="286" height="110" /></td></tr></table>
<table width="286" height="110"><tr><td><img src="http://www.google.com/intl/zh-CN_ALL/images/logo.gif" width="286" height="110" /></td></tr></table>
<table width="286" height="110"><tr><td><img src="http://www.google.com/intl/zh-CN_ALL/images/logo.gif" width="286" height="110" /></td></tr></table>
<table width="286" height="110"><tr><td><img src="http://www.google.com/intl/zh-CN_ALL/images/logo.gif" width="286" height="110" /></td></tr></table>
<table width="286" height="110"><tr><td><img src="http://www.google.com/intl/zh-CN_ALL/images/logo.gif" width="286" height="110" /></td></tr></table>
<table width="286" height="110"><tr><td><img src="http://www.google.com/intl/zh-CN_ALL/images/logo.gif" width="286" height="110" /></td></tr></table>
<table width="286" height="110"><tr><td><img src="http://www.google.com/intl/zh-CN_ALL/images/logo.gif" width="286" height="110" /></td></tr></table>
</td>
</tr>
</table>
----------------------------------------------------------------------------------

guang1027 2006-10-26
  • 打赏
  • 举报
回复
white-space:normal 加到tr的样式里 试试 不管你的table是百分比还是固定数值都应该好用
freelyl 2006-10-25
  • 打赏
  • 举报
回复
你的TABLE用百分比宽度可以吧。
myvicy 2006-10-25
  • 打赏
  • 举报
回复
css就可以了。

28,409

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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