0

I am trying to figure out how to have a row of a table with two td tags stay on top of another row with only one td tag and align perfectly. I've tried colspan="2" on the bottom row but that doesn't work.

Here is what I have so far:

 <table cellpadding="0" cellspacing="0" border="0" width="800"><!--wrapper-->
    <table border="1">
        <tr>
            <td style="width: 50px"><img src="images/img1.jpg" />
            </td>
            <td><img src="images/img2.jpg" />
            </td>
            </tr>
            <tr colspan="2">
            <td><img src="images/img3.jpg" />
            </td>
            </tr>
        </table>
  </table>
4

2 回答 2

5

改变

<tr colspan="2">
    <td><img src="images/img3.jpg" />
</td>

<tr>
    <td colspan="2"><img src="images/img3.jpg" />
</td>

colspan应该在td

于 2013-06-18T15:49:06.843 回答
0

colspan属于<td>不是<tr>

<table cellpadding="0" cellspacing="0" border="0" width="800">
    <!--wrapper-->
    <table border="1">
        <tr>
            <td style="width: 50px">
                <img src="images/img1.jpg" />
            </td>
            <td>
                <img src="images/img2.jpg" />
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <img src="images/img3.jpg" />
            </td>
        </tr>
    </table>
</table>

jsFiddle 示例

于 2013-06-18T15:49:24.740 回答