Page 1 of 2
Valign body.
Posted: Fri Jan 26, 2007 1:17 pm
by JellyFish
Hi, I tried:
And it didn't vertically align all the content within the body tags. How would I do this?
Thanks for reading. All help is appreciated.
Posted: Fri Jan 26, 2007 1:27 pm
by Kieran Huggins
Vertical centering is a much-sought-after thing. Google will have lots of info on the subject.
Short answer: only table cells support this behaviour, but it can be emulated.
Posted: Fri Jan 26, 2007 1:37 pm
by JellyFish
Thanks Kieran. So I'd guess I could just wrap my content within a table. Or is there another way?
Posted: Fri Jan 26, 2007 1:51 pm
by Kieran Huggins
ug.. I'd never suggest that! Google it up - there are a zillion solutions for "vertical centering"
Posted: Fri Jan 26, 2007 2:00 pm
by JellyFish
I got a result that says to set the body's display property to table-cell and then use the vertical-align property. Is this recommened?
EDIT: Wait, that didn't work.
EDIT 2: All of the information that I've been getting from google are saying the same thing. That is to wrap something around the content in the body, div mostly.
Why wouldn't you suggest using a table? Would a div be better?
Posted: Fri Jan 26, 2007 2:12 pm
by daedalus__
the gods of web development hate table-based layouts!
Posted: Fri Jan 26, 2007 2:13 pm
by Kieran Huggins
Table layouts are evil - I'd use javascript first.
Posted: Fri Jan 26, 2007 2:14 pm
by Luke
Kieran Huggins wrote:Table layouts are evil - I'd use javascript first.
don't think I'd go that far... I still use a table for layout every once in a blue moon for those clients who just want it done cheap and fast.
Posted: Fri Jan 26, 2007 2:17 pm
by JellyFish
Daedalus- wrote:the gods of web development hate table-based layouts!
Why? I love them.
Table layouts are evil - I'd use javascript first.
Is that the only reason I shouldn't use them, cause if so it doesn't convince me...

Posted: Fri Jan 26, 2007 2:22 pm
by Luke
http://www.google.com/search?q=css+desi ... out+tables
Tables aren't meant for site layout. They're meant for data layout.
oh yea... this too:
http://www.csszengarden.com
If you want to be considered professional in any way, design without tables.
Posted: Fri Jan 26, 2007 2:46 pm
by RobertGonzalez
Tables are for tabular data display, not marking up your document. There are a bunch of methods than can be used to center a div on the screen. I would look at A List Apart for some helpful topics, or google search for 'vertical alignment of content in div'.
PS There is nothing than cannot be designed with proper CSS than can be built with tables. And never turn to tables for layout. Never. you can seriously knock out a CSS layout just as fast as a table-based layout, without all the cruft.
Posted: Fri Jan 26, 2007 4:45 pm
by JellyFish
Everah wrote:you can seriously knock out a CSS layout just as fast as a table-based layout, without all the cruft.
Cruft? Honestly I don't see why not. It works good and I'm not really interested in a title (professional).
Posted: Fri Jan 26, 2007 4:49 pm
by feyd
How about accessibility?
Posted: Fri Jan 26, 2007 5:02 pm
by JellyFish
It wouldn't be that hard if the table wasn't to complex.
Posted: Fri Jan 26, 2007 5:34 pm
by RobertGonzalez
JellyFish wrote:Everah wrote:you can seriously knock out a CSS layout just as fast as a table-based layout, without all the cruft.
Cruft? Honestly I don't see why not. It works good and I'm not really interested in a title (professional).
If not accessibility, why are you not interested in semantic development? Or the actual readable mark up document? Sure, tables are the easiest thing to use (when you are not a professional designer), they are simply not the best, or intended, tool to use.