如何使并排的多个表格在窗口缩小时被挤压分行?

jzsh2000 2006-01-06 02:34:31
如果是并排的多个图片,当窗口宽度小于图片宽度之和的时候,后面的图片就会被挤压分行,请问这种效果如何在并排的表格中实现?代码如下:
==============================
<html><body>
<table border="1" width="100%">
<tr>
<td>
<img src="http://community.csdn.net/logo/Images/eye001.gif" width="300">
<img src="http://community.csdn.net/logo/Images/eye001.gif" width="300">
<img src="http://community.csdn.net/logo/Images/eye001.gif" width="300">
<img src="http://community.csdn.net/logo/Images/eye001.gif" width="300">
<img src="http://community.csdn.net/logo/Images/eye001.gif" width="300">
<img src="http://community.csdn.net/logo/Images/eye001.gif" width="300">
</td>
</tr>
</table>
<table border="1" width="100%">
<tr>
<td>
<table border="1" width="300" align="left"><tr><td>11</td></tr></table>
<table border="1" width="300" align="left"><tr><td>22</td></tr></table>
<table border="1" width="300" align="left"><tr><td>33</td></tr></table>
<table border="1" width="300" align="left"><tr><td>44</td></tr></table>
<table border="1" width="300" align="left"><tr><td>55</td></tr></table>
<table border="1" width="300" align="left"><tr><td>66</td></tr></table>
</td>
</tr>
</table>
</body></html>
...全文
232 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
jouwei 2006-01-10
  • 打赏
  • 举报
回复
楼上的方法不错。但不知可有通用一点方法?
比如将下面表格的各列也自动分行?
<table border="1" width="300" align="left">
<tr><td>11</td><td>22</td><td>33</td><td>44</td></tr>
</table>
jzsh2000 2006-01-10
  • 打赏
  • 举报
回复
非常感谢:)
ice_berg16 2006-01-09
  • 打赏
  • 举报
回复
设置要自动换行的表格的float:left;
------------------------------------------------
<html>
<style>
#tbl table{
float:left;
}
</style>
<body>
<table border="1" width="100%">
<tr>
<td>
<img src="http://community.csdn.net/logo/Images/eye001.gif" width="300">
<img src="http://community.csdn.net/logo/Images/eye001.gif" width="300">
<img src="http://community.csdn.net/logo/Images/eye001.gif" width="300">
<img src="http://community.csdn.net/logo/Images/eye001.gif" width="300">
<img src="http://community.csdn.net/logo/Images/eye001.gif" width="300">
<img src="http://community.csdn.net/logo/Images/eye001.gif" width="300">
</td>
</tr>
</table>
<table border="1" width="100%">
<tr>
<td id="tbl">
<table border="1" width="300" align="left"><tr><td>11</td></tr></table>
<table border="1" width="300" align="left"><tr><td>22</td></tr></table>
<table border="1" width="300" align="left"><tr><td>33</td></tr></table>
<table border="1" width="300" align="left"><tr><td>44</td></tr></table>
<table border="1" width="300" align="left"><tr><td>55</td></tr></table>
<table border="1" width="300" align="left"><tr><td>66</td></tr></table>
</td>
</tr>
</table>
</body></html>

fengzi0924 2006-01-09
  • 打赏
  • 举报
回复
关注!!!
jzsh2000 2006-01-09
  • 打赏
  • 举报
回复
没有人能够实现吗?
jzsh2000 2006-01-06
  • 打赏
  • 举报
回复
图片显示的只是效果,我希望下面的表格也能做到同样的效果,在1024下显示2排每排3个,当缩小窗口小于900的时候显示3排每排2个,再缩小小于600的时候显示6排每排1个
myppfly 2006-01-06
  • 打赏
  • 举报
回复
什么意思啊?
是想让图片分几行显示啊?

61,112

社区成员

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

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