我有一个 div 居中在另一个 div 中,其中包含我的页面内容(在这种情况下,是一个包含一些信息的表格)但是,我无法让它显示背景图像,因为它的高度不会扩展到它的表格的高度包含。有人能告诉我为什么吗?
<div>
<div style="width: 900px; margin: auto; border: 1px solid #F00;">
<table align="right">
<tr><td>Something to make the hight of the container not zero</td></tr>
</table>
</div>
</div>
更新
我道歉,我省略了align = "right"
表格元素(并在下面回答了我的问题)