Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cannot get the height to fill containing table cell 1

Status
Not open for further replies.

HisMightiness

Programmer
Mar 17, 2004
54
US
I have a complex layout that is dynamically generated. The snipped I am posting below is contained within a parent table cell. I need the HTML object in the snippet below to fill the parent table cell, but for some reason, I cannot figure out which element(s) is/are keeping me from getting this to work right.

Code:
<div ID="UpdatePanel1" style="height:100%;">
<table id="tblMainSearchContainer" border="0" cellpadding="0" cellspacing="0" width="316" height="100%" style="width:316px;height:100%;">
    <tr height="100%" style="height:100%;">
        <td height="100%" style="vertical-align:top;height:100%;">
            <table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%" style="height:100%;">
                <tr height="100%" style="height:100%;">
                    <td id="cellTravelSearch" class="rhtravelsearch_bckgd" style="vertical-align:top;background-color:#4B678E;height:100%;">
<!-- 
ANY NUMBER OF DYNAMIC ELEMENTS ARE LOADED HERE 
-->
</td>
                    <td class="rhtravelsearch_border_right"><img src='<%=String.Concat(Me.ModulePathFull, "images/spacer.gif")%>' width="15" height="15" alt="" /></td>
                </tr>
                <!--tr height="15" style="height:15px;">
                    <td class="rhtravelsearch_border_bottom">&nbsp;</td>
                    <td class="rhtravelsearch_corner_bot_right">&nbsp;</td>
                </tr-->
            </table>
        </td>
    </tr>        
</table>
</div>
I need everything in the first DIV to grow to 100% to fill the area that this snippet is in. Can someone please help me?

Will
 
Unless the table cell has a defined height (which I presume it does not have), then having [tt]height: 100%;[/tt] on the div will make no difference. Because 100% of the unknown height is unknown and as such ignored.

You need to define how high your table cell is, if you want to do it like that. Alternatively, you do not define any of it and the content will push the table cell to make it fit all the content, effectively making the content fill the entire cell.

___________________________________________________________
[small]Do something about world cancer today: PACT[/small]
 
Stop using table layouts. Most of your troubles will go away id you drop the tables where tables should not be used, and use standard (and semantically correct) CSS and XHTML.

Tables are for tabular data.

[plug=shameless]
[/plug]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top