Log in

View Full Version : Tables -vs- Divs -vs- ... w/e else



lord_havoc
04-22-2007, 05:32 AM
So I hear people hating on tables because they were devised as a way to display information that needed a table. But I also hear people who are against divs. So what is the overall best choice (Whether it be tables, divs or otherwise) in creating your average, everyday website?

Please tel me, I am very curious.

boxxertrumps
04-22-2007, 05:35 AM
divs are designed for page divisions, while tables are for tabular data.
For layout, use divs.
For data, use tables.

Who hates divs?

lord_havoc
04-22-2007, 05:39 AM
Just different sites I have found over time that have a blog entry or the equivalent complaining about divs. I personally use divs. But, with divs, how do you overcome the problem of someone having their screen at a higher resolution so that there isn't so much extra space around your layout.

Twey
04-22-2007, 12:00 PM
I've never seen anything like that. Tables are bad to use for layout because they're not meant to be used for layout (resulting in semantically incorrect markup), they result in a lot of presentational HTML that's hard to maintain and has to be downloaded every time someone views your page, and nested tables are very slow to render.

"Using <div>s" isn't a design methodology. The <div> element is a generic block-level element without semantics that's used in page layouts to apply style to parts of a page.
But, with divs, how do you overcome the problem of someone having their screen at a higher resolution so that there isn't so much extra space around your layout.Thus, that's not a problem of "using <div>s," but of the specific CSS layout you've been using. If you use a more fluid layout, this won't be a problem.

boogyman
04-22-2007, 04:11 PM
Who hates divs?

people that don't know css tend to hate divs

mburt
04-23-2007, 01:06 AM
Unless you know CSS with a fair amount of ease, writing page layouts with DIV's isn't easy. Personally, I think, with a good tutorial on anything it can become "easy", or natural.
Though aside from page layouts, tables seem easier to write when encourperating other scripts, such as a data generator via PHP. Gives a better idea of the column/row structure.

nwalton
04-23-2007, 10:18 PM
with divs, how do you overcome the problem of someone having their screen at a higher resolution so that there isn't so much extra space around your layout.

You can't (and probably don't even want) to control every bit of everyone's browsing experience. People can resize their browser window so it's really big or really small, change the text size, turn images on or off-- all sorts of things. The best thing to do is to make your designs so they adapt to these variables.

(As for that specific question, I usually like to center my designs in the browser window, so you at least get even space on both sides.)