Closed Thread Icon

Topic awaiting preservation: Matching the height of a table with a div (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=27292" title="Pages that link to Topic awaiting preservation: Matching the height of a table with a div (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: Matching the height of a table with a div <span class="small">(Page 1 of 1)</span>\

 
Maskkkk
Paranoid (IV) Inmate

From: Indiana, PA
Insane since: Mar 2002

posted posted 01-09-2006 20:18

If I want to take a div and strech it out so that it is the same height as a % sized table, how do I go about this?

Thanks,



- AIM: MASKKKK

01001101011000010111001101101011011010110110101101101011

poi
Paranoid (IV) Inmate

From: Norway
Insane since: Jun 2002

posted posted 01-09-2006 20:32

Apply the offsetHeight+'px' of the TABLE to the style.height of the DIV

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 01-09-2006 20:41

Note this has to be done using a page onload handler (or from some event after the page loads). If you just do it with a script in the head it will error.



.:[ Never resist a perfect moment ]:.

(Edited by bitdamaged on 01-09-2006 20:42)

Maskkkk
Paranoid (IV) Inmate

From: Indiana, PA
Insane since: Mar 2002

posted posted 01-09-2006 20:49

Wow that's so great! Thanks alot!



- AIM: MASKKKK

01001101011000010111001101101011011010110110101101101011

Skaarjj
Maniac (V) Mad Scientist

From: :morF
Insane since: May 2000

posted posted 01-10-2006 05:11

You should also, I believe, be able to place a wrapper div around the table and the div you want ot match its height, invisibly, and have the matching div's height set to 100%. It should* then stetching up and down to fit the height of the wrapper, no matter how big it may get.

* and I mean should. I'm not sure on this score as I've never done it before


Justice 4 Pat Richard

poi
Paranoid (IV) Inmate

From: Norway
Insane since: Jun 2002

posted posted 01-10-2006 09:17

[quickie] Skaarj: don't have the time to make a testcase but I seem to remember that in that case the DIV that is not stretched by the TABLE would take 100% of the visible viewport, not 100% of its parent. [/quickie]

Skaarjj
Maniac (V) Mad Scientist

From: :morF
Insane since: May 2000

posted posted 01-10-2006 12:03

Hmm... let me throw something together, and we shall see the whichness of the why.

[edit]Well, you're sort of correct. It doesn't expand to fit the height like I thought it would. What it does instead, though, is fits is content+paddings and leaves it at that.[/edit]


Justice 4 Pat Richard

(Edited by Skaarjj on 01-10-2006 13:32)

« BackwardsOnwards »

Show Forum Drop Down Menu