homepage Welcome to WebmasterWorld Guest from 54.227.41.242
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

    
Getting a table to scale 100% vertically
Seems to only want to scale the minimum required amount.
adni18




msg:4195343
 11:49 pm on Sep 1, 2010 (gmt 0)

Hi all,

Basically what I want to do is get a table, which is inside of a TD (don't ask -- I've tried the rowspan setup and it doesn't like to work for this purpose), to span the entire height of the TD. Here's what I've got so far (color-coded to visualize the elements).

The table doesn't want to stretch to fill the available height. Any ideas why?



<table align="center" width="80%" cellspacing=0 cellpadding=0 border=0>



<tr>
<td bgcolor=red align=center width="20%">
<img alt='' src='http://example.com/avatar.png' class='avatar avatar-32 photo avatar-default' height='32' width='32' /><br>
<nobr><a href='http://example.com/' rel='external nofollow' class='url'>John Smith</a></nobr>
</td>
<td bgcolor=orange style="padding:0px">
<table width="100%" height="100%" style="margin:0px" bgcolor=blue cellspacing=0 cellpadding=0>
<tr>
<td>
blah blah blah
</td>
</tr>
<tr>
<td bgcolor=black valign=bottom height=20>
Delete Edit etc.
</td>
</tr>
</table>
</td>
</tr>


</table>

 

choster




msg:4195826
 11:01 pm on Sep 2, 2010 (gmt 0)

There is no "height" attribute for <table>.

If the height of the <td> is fixed, try setting style="height:100%" on the table.


As a friendly suggestion— the code you posted is rather inconsistent, mixing HTML attributes and inline CSS, single quotes vs double quotes vs no quotes, using the non-standard <nobr> tag while omitting standard ones like <tbody>. Overall, this can make things rather difficult to debug, especially since an unbalanced tag or even a missing character can "break" a page badly. I would recommend choosing and sticking to a coding style suitable for the DOCTYPE you're using (and I hope I do not presume too much to presume you have set a proper DOCTYPE).

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / HTML
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved