将照片定位在网格中(HTML)

时间:2010-06-01 01:44:21

标签: html css xhtml html-table

我一直在尝试编码this page一段时间,但我最大的问题是我似乎无法将照片完美地定位。出于某种原因,每个<td>中都有一个小的底部填充,这会使事情变得混乱。

这是表格代码:

<table>
    <tr>
        <td rowspan="2" style="height:353px;"><img src="danoconnor/img/photography/farm.jpg" height="353" width="470" alt="Farm" /></td>
        <td><img src="danoconnor/img/photography/paragliding.jpg" height="190" width="254" alt="Paraglider" /></td>
        <td rowspan="2"><img src="danoconnor/img/photography/cristo.jpg" height="353" width="230" alt="Cristo Redentor" /></td>
    </tr>
    <tr>
        <td><img src="danoconnor/img/photography/u2.jpg" height="154" width="254" alt="U2 at Fordham University" /></td>
    </tr>
</table>

我的问题是:如何使the photogrid看起来像这样:

1 个答案:

答案 0 :(得分:1)

如果你没有使用css,你仍然可以通过将开始表标签更改为:

来实现
<table cellspacing="0" cellpadding="0" border="0">

我还要在最后一个td标记中添加valign =“bottom”,以确保图片下面没有空格:

<tr>
    <td valign="bottom"><img src="danoconnor/img/photography/u2.jpg" height="154" width="254" alt="U2 at Fordham University" /></td>
</tr>
相关问题