Forum Moderators: not2easy

Message Too Old, No Replies

TD fill remaining space

         

Readie

3:59 am on Jan 11, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



OK, I searched for this quite some time ago with no joy, and I find myself in a position to do need this again.

Is it possible to declare a table(and body/html) height of 100%, and have a td element that stretches to fill remaining space without entering into quirks mode?

(so in quirks mode):

<table height="100%">
<tr>
<td height="50">Stuff</td>
</tr>
<tr>
<td height="*">Stuff</td>
</tr>
</table>

I have tried declaring max-height: parameters for all of the static <td>s and this hasn't worked.

Drag_Racer

3:32 pm on Jan 11, 2010 (gmt 0)

10+ Year Member



Hey Readie,

the height attribute for tables/td has been depreciated and should no longer be used.

[w3.org...]

look for a css solution to your effort.

you may find what your looking for @

[css-tricks.com...]

Readie

11:03 pm on Jan 11, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks Drag_Racer, but I was aware that the height value is deprecated and was merely providing that as an example for what would work if no doctype was declared.

I didn't manage to find what I was looking for on the pages that you linked, and the second link was getting a table to 100% (the easy bit :)) not getting a table row (or tbody) to fill the remaining available space.

I did pick up a few useful things from the first link though, so thanks for that :).

Regards,
Readie

swa66

11:19 pm on Jan 11, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Take a look at this library post: [webmasterworld.com...]

Just make the header however high as you need it, and if you need it you can remove the width, centering and borders from that example easy enough.