Q:

Automatic HTML Document Height with Content

I'm having trouble getting the height of my HTML divs to scale with the content of my PHP-generated table.
The table I'm using might change size so I don't want to set the height of the parent divs statically, but I can't seem to get it to work otherwise.  I'm not floating anything.
The main script for this page is like this:
<div id="wrapper">

<div id="contentmain">
    <div id="contentleft">
        <?php
        include ('get_table.php');
        ?>
    </div>
    <div id="contentright">

    </div>
</div>

</div>

I thought that if #wrapper and #contentleft has height:auto or height unset that the table would decide the size of those divisions, but instead the table just sits on its own, extending into white space while the divs sit as thin lines at the top.
CSS:
#contentmain
{
    width:940px; 
    height: 1164px; 
    background-color:aqua;
    margin: 10px 10px 0px 10px;
}

#contentleft
{
    width: 700px; 
    height:inherit;
    background-color: #CAE2ED;
    position:absolute;
}

table
{
    border-spacing:8px;
    font-family:Georgia, serif;
    padding:0px;
    box-shadow:1px 0px 5px 0px #000000;
    border-top-left-radius:5px;
    border-top-right-radius:5px;
    border-bottom-left-radius:3px;
    border-bottom-right-radius:3px;
    margin:0 auto;
    background-color:white;
    /*border-collapse: separate;
    border-spacing: 0 10px;*/
}

Note: contentleft is resizing with the table properly, but contentmain and wrapper are not.
Any help appreciated!

A:

Try this css:
#contentmain
{
    width:940px; 
    height: 1164px; 
    background-color:aqua;
    margin: 10px 10px 0px 10px;
    display:inline;
}

#contentleft
{
    width: 700px; 
    height:inherit;
    background-color: #CAE2ED;
    position:absolute;
    display:inline;
}

table
{
    border-spacing:8px;
    font-family:Georgia, serif;
    padding:0px;
    box-shadow:1px 0px 5px 0px #000000;
    border-top-left-radius:5px;
    border-top-right-radius:5px;
    border-bottom-left-radius:3px;
    border-bottom-right-radius:3px;
    margin:0 auto;
    background-color:white;
    display:inline;
    /*border-collapse: separate;
    border-spacing: 0 10px;*/
}

