所以你想在表网格中有图像,并让它响应窗口大小调整始终适合。
标记(在这个例子中,我的网格是3x3,但7x7的工作方式相同,只是添加更多的数据单元格和行)。
<div id="wrapper">
<table>
<tr>
<td><img src="http://farm7.staticflickr.com/6115/6249486517_884b897248_o.jpg"></td>
<td><img src="http://farm7.staticflickr.com/6115/6249486517_884b897248_o.jpg"></td>
<td><img src="http://farm7.staticflickr.com/6115/6249486517_884b897248_o.jpg"></td>
</tr>
<tr>
<td><img src="http://farm7.staticflickr.com/6115/6249486517_884b897248_o.jpg"></td>
<td><img src="http://farm7.staticflickr.com/6115/6249486517_884b897248_o.jpg"></td>
<td><img src="http://farm7.staticflickr.com/6115/6249486517_884b897248_o.jpg"></td>
</tr>
<tr>
<td><img src="http://farm7.staticflickr.com/6115/6249486517_884b897248_o.jpg"></td>
<td><img src="http://farm7.staticflickr.com/6115/6249486517_884b897248_o.jpg"></td>
<td><img src="http://farm7.staticflickr.com/6115/6249486517_884b897248_o.jpg"></td>
</tr>
</table>
</div>
的CSS:
#wrapper{width: 100%;}
#wrapper table {width: 100%;}
#wrapper table tr td {width: 33%;}
#wrapper table tr td img {width: 100%;}
使用的一些随机图像从Flickr。
希望它有帮助。
为什么你需要一张桌子呢?更容易与49个div(或直接img),浮动和宽度/高度1/7容器... – jtheman