I have a div that is centered inside another div that contains my page content (in this case, a table with some information) However, I cant get it to show a background image because its height doesnt expand to the height of the table that it contains. Can someone tell me why?
<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>
UPDATED
I apologise, I omitted the align = "right" on the table element (and have answered my question below)
PROBLEM SOLVED
As soon as you put the attribute
align = "right"on your table element, it turns it into a floating element (equivalent to the style propertyfloat: right. Floating elements are considered to take up no height, because they’re floating… hence the height of the containing div remains zero.Thanks for your inputs and my apologies once again for the omission.