user3740413
user3740413

Reputation: 11

How do I align this div inside a table relative to one of the table's cells?

This is what I have right now from this code:

<table><tr>
    <td><div id="adt"></div></td> <!-- 336x280 ad code -->
    <td id="butw"><div id="butto">Follow @Twitter</div></td> <!-- Twitter Button -->
    <td><div id="ado"></div></td> <!-- 300x600 ad code -->  
</tr></table>

(image of the result)

My goal is to get the Twitter div to be aligned underneath the first TD. I'm not sure whether to use CSS to align the div relative to the table cell or if there's another method I'm forgetting.

Upvotes: 1

Views: 54

Answers (1)

Rahul Desai
Rahul Desai

Reputation: 15481

One way to do this is by moving the Twitter div to the next row.

<table>
    <tr>
        <td><div id="adt"></div></td> <!-- 336x280 ad code -->
        <td><div id="ado"></div></td> <!-- 300x600 ad code -->  
    </tr>
    <tr>
        <td id="butw"><div id="butto">Follow @Twitter</div></td> <!-- Twitter Button -->
        <td> <!-- extra TD here --> </td>
    </tr>
</table>

Upvotes: 1

Related Questions