开发者

Force DIV full height within table TD

I got this:

<style>
.topdiv {
    vertical-align:top
}
.bottomdiv {
    vertical-align:bottom
}
</style>

<table border="1" cellspacing="0" cellpadding="0">
    <tr>
        <td>
            content<br/>
            content<br/>
            content<br/>
            content<br/>
            This cell holds content that is higher than t开发者_开发百科he right side<br/>
            content<br/>
            content<br/>
            content<br/>
            content
        </td>
        <td>
            <div class="containerdiv">
                <div class="topdiv">
                    I want this DIV at the top of the cell
                </div>
                <div class="centerdiv">
                    I want this DIV in the middle of the cell
                </div>
                <div class="bottomdiv">
                    I want this DIV at the bottom of the cell
                </div>
            </div>
        </td>
    </tr>
</table>

I hope the text explains my problem well enough :)


First of all, it is a bad idea to have table layouts in 2011, let alone mix table and div layouts!

I feel it is far simpler to do this in a div-only layout than this one.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜