作为一个表格单元格内的绝对定位this question的后续行动,我试图让一些在Firefox中工作。再次,我在这里约95%,并且只有一点让我无法宣告胜利。使用后续样品标记:如何获得div来垂直填充表格单元格?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Test</title>
<style type="text/css">
table { width:500px; border-collapse:collapse}
th, td { border:1px solid black; vertical-align: top; }
th { width:100px; }
td { background:#ccc; }
.wrap { position:relative; height:100%; padding-bottom:1em; background:#aaa; }
.manage { text-align:right; position:absolute; bottom:0; right:0; }
p{ margin: 0 0 5px 0; }
</style>
</head>
<body >
<table>
<tr>
<th>Mauris tortor nulla, sagittis ut, faucibus eu, imperdiet ut, libero.</th>
<td><div class="wrap"><p>Cras diam.</p><div class="manage">Edit | Delete</div></div></td>
</tr>
<tr>
<th>Cras diam.</th>
<td><div class="wrap"><p>Cras diam.</p><div class="manage">Edit | Delete</div></div></td>
</tr>
<tr>
<th>Cras diam.</th>
<td><div class="wrap"><p>Mauris tortor nulla, sagittis ut, faucibus eu, imperdiet ut, libero. Sed elementum. Praesent porta, tellus ut dictum ullamcorper, est ante condimentum metus, non molestie lorem turpis in sapien. Aenean id enim. Nullam placerat blandit ante. Aenean ac ligula.</p><div class="manage">Edit | Delete</div></div></td>
</tr>
</table>
</body>
</html>
我怎样才能获得包装的div总是充满细胞,从而使管理区坐落在小区的底部?是的,我放在桌子上的数据(在我的脑海里)是表格式的,所以我想在这里使用一个表格。作为最后的手段,我可能会转向一个丑陋的嵌套的div解决方案,但是由于表格在语义上是正确的,所以我想尽可能使用一个表格。请注意,背景颜色只是显示元素的相对大小 - 我不关心我的布局的背景。另外请注意,我希望单元具有灵活的高度,以便它们只扩展到足以适应其内容。
没有,我需要得到管理div来在Firefox中电池的底部。背景只是为了显示元素的大小。 – 2008-11-14 22:12:19