Height: 100%

For quick answers to quick questions on whatever subject you need!

Moderator: Thought Police

Locked
Penfold
Delta (Bokanovsky)
Delta (Bokanovsky)
Posts: 185
Joined: Fri Jan 10, 2003 3:08 am
Location: London

Height: 100%

Post by Penfold »

Any help on the best way to implement table height so that it fills 100% of the window vertically? Got a repeating bar (background image: repeat-y etc) down one side, works in IE but not in Firebird.

Currently using:
<table ... height="100%">
Image
Charmaka
Alpha (Conditioned)
Alpha (Conditioned)
Posts: 2345
Joined: Sat Mar 16, 2002 7:31 pm
Location: Inside my own head
Contact:

Post by Charmaka »

Is it nested inside another element? You could try messing around with absolute height
"Why do you hate America so much?"(TM)
heavy-rotation
Thought Police
Thought Police
Posts: 1205
Joined: Thu Mar 14, 2002 12:11 pm
Location: Macclesfield
Contact:

Post by heavy-rotation »

You can't use percentage heights in XHTML... eh, I don't have a solution the doesn't involve javascript.
Penfold
Delta (Bokanovsky)
Delta (Bokanovsky)
Posts: 185
Joined: Fri Jan 10, 2003 3:08 am
Location: London

Post by Penfold »

I'm not up on XHTML, just being happy complying to HTML 4.01.
I think I'm going to go for something different anyway. Tried applying different attributes, heights and so on, but it's not getting on with me.
Thanks.
Image
Charmaka
Alpha (Conditioned)
Alpha (Conditioned)
Posts: 2345
Joined: Sat Mar 16, 2002 7:31 pm
Location: Inside my own head
Contact:

Post by Charmaka »

Incidentally, does it have to be a table? It's sometimes easier to use a div I find
"Why do you hate America so much?"(TM)
heavy-rotation
Thought Police
Thought Police
Posts: 1205
Joined: Thu Mar 14, 2002 12:11 pm
Location: Macclesfield
Contact:

Post by heavy-rotation »

Penfold wrote:I'm not up on XHTML, just being happy complying to HTML 4.01.
I think I'm going to go for something different anyway. Tried applying different attributes, heights and so on, but it's not getting on with me.
Thanks.
In that case, do you have the html 4 doctype declaration in your page?
Penfold
Delta (Bokanovsky)
Delta (Bokanovsky)
Posts: 185
Joined: Fri Jan 10, 2003 3:08 am
Location: London

Post by Penfold »

It doesn't have to be in a table, just that's what I'm comfortable with. I'm going for the centred 800x600 table, but I'm trying not to fall into the 3-column, navigation on the left thing.

I do have the doctype declaration (transitional one); the html and the css validated. (Up to the point I started changing things).
I'm in the slap-it-all-in-and-worry-later stage.
Image
Kajun
World Controller
World Controller
Posts: 10412
Joined: Tue Jan 22, 2002 12:00 am
Location: Hear.
Contact:

Post by Kajun »

Kajun is awaiting approval.
Charmaka
Alpha (Conditioned)
Alpha (Conditioned)
Posts: 2345
Joined: Sat Mar 16, 2002 7:31 pm
Location: Inside my own head
Contact:

Post by Charmaka »

Yeah, we had that problem before on the school site - if the body is longer that the screen height we couldn't find a way to make the sidebar the right length. Still works for a lot of things tho. I'm still not sure he's 100% right in this case tho - for my site (mindshark.net) I've been playing around with coloured bars made with div tags, and specifying margins allows you to place them quite comfortably - and this is using divs with a defined background colour and placement but no other attributes or content
"Why do you hate America so much?"(TM)
Kajun
World Controller
World Controller
Posts: 10412
Joined: Tue Jan 22, 2002 12:00 am
Location: Hear.
Contact:

Post by Kajun »

Kajun is awaiting approval.
Kajun
World Controller
World Controller
Posts: 10412
Joined: Tue Jan 22, 2002 12:00 am
Location: Hear.
Contact:

Post by Kajun »

>
> > It's a conundrum. The W3C doesn't even know!
>
> The CSS 2 recommendation does spell it out [1], sort of -- but with
>much wind, leaving a wake of confusion. To set one object's height to 100%
>of the height of its containing block doesn't seem so complicated. But what
>seems to be the tripping point is what to do when an element -- namely, the
>html element -- is at the top of the hierarchy and has no containing block.
>The obvious answer would appear to be that setting the height of the html
>element to 100% would be 100% of the viewport, as was essentially the
>traditional behavior of browsers (although it's probably more accurate to
>say that a 100% height on the html -- or, in the old days, the body --
>element was equivalent to min-height: 100%, since such elements would
>freely expand if their content exceeded the height of the viewport). Maybe
>a value of "viewport" should be added to height/min-height/max-height just
>to help
>settle the issue...

The connection between the HTML document and the viewport is one of the
greatest problems/unexplored areas in the standards. Basically, to whichever
standard you go you'll find problems in exactly this area

CSS - the height problem described here
DOM - W3C doesn't define any properties of the viewport, like clientWidth,
or the HTML document in connection with the viewport, like scrolling
offsets.

W3C doesn't have the faintest idea what to do with the viewport.
http://lists.evolt.org/archive/Week-of- ... 39560.html
Kajun is awaiting approval.
Penfold
Delta (Bokanovsky)
Delta (Bokanovsky)
Posts: 185
Joined: Fri Jan 10, 2003 3:08 am
Location: London

Post by Penfold »

Thanks for that CSS maxheight tables link. Might be worth a try, but I've seen too many issues with differences in the way they're rendered - or just the fact my brain would probably fail trying to do it. The format I've got now is a 760 width table nested inside a 100% width table - without the sidebar image I was originally after.
Image
Locked