【问题标题】:Force DIV full height within table TD在表格 TD 内强制 DIV 全高
【发布时间】:2011-06-13 06:58:47
【问题描述】:

我知道了:

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

我希望文本能很好地解释我的问题:)

【问题讨论】:

  • 我已经jsfiddle为您和其他人提供了它。

标签: css html html-table


【解决方案1】:

首先,2011年有表格布局是个坏主意,更别说混合表格和div布局了!

我觉得在只有 div 的布局中做这件事比这个简单得多。

【讨论】:

  • 谁说这是布局?也可以是表示数据的表格。
  • midas : 'higher than the right side' 'top' 'center' and 'bottom' , 响铃?
  • 也可用于以HTML E-Mail结尾,因此使用表结构可能是合理的。
猜你喜欢
  • 2014-01-13
  • 2011-04-19
  • 2011-10-03
  • 2013-12-29
  • 2012-10-24
  • 1970-01-01
  • 1970-01-01
  • 2014-06-05
相关资源
最近更新 更多