Force DIV на полную высоту в пределах таблицы TD - PullRequest
1 голос
/ 13 июня 2011

Я получил это:

<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 the 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>

Надеюсь, текст достаточно хорошо объясняет мою проблему:)

1 Ответ

0 голосов
/ 13 июня 2011

Прежде всего, плохая идея иметь макеты таблиц в 2011 году, не говоря уже о том, чтобы смешивать макеты таблиц и div!

Я чувствую, что гораздо проще сделать это в макете только для div, чемодин.

...