Forum Moderators: open

Message Too Old, No Replies

Tables vs. Divs for page layout

Which to design with?

         

iJeep

5:02 pm on Dec 16, 2002 (gmt 0)

10+ Year Member



I started out in my early days of my e-commerce site with unimaginable numbers of tables. As I have learned more about web browsers and search engines I converted about 99% of those tables to DIVs due to the dynamic loading where it shows everything load and it comes in.

The only problem is that I get about the same amount or more of my Netscape users using NN4 compared to a newer version. I have gotten complaints about the site exploding in their browser because it doesn't support all of the CSS. I have been working on a project to offer a site just for these people as an alternative to the main site which is newer browser optimized. The only problem is that I cannot get the layout of the new site to look halfway decent without the use of tables (and nested tables) on every page.

This makes it loads a little slower, though the entire page with graphics is weighing in at about 25k. Should I just give in and do the site in tables so that these older browsers that I am targeting can view it right, or should I use DIV tags and try to make it at least somewhat useable.

My main problem comes with width:100% on a div tag in NN4.

Nick_W

7:01 pm on Dec 16, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi ijeep,

You might like to have a look at this discussion we had in CSS about NN4 and CSS [webmasterworld.com] there is some great stuff in there from tedster that may help you.

I think if you show a high number of NN4 users then you certainly have to take steps to accomadate them. What those steps might be is a whole new question ;)

Nick

crosenblum

6:51 pm on Dec 18, 2002 (gmt 0)

10+ Year Member



There's two parts to this answer.

One, tables are the html standard are more globally accepted.

Two, it may help do some planning of your content and how it is table-oriented. So as to not put yourself in the situation of requiring 13 nested levels of tables.

Sometimes you can break things into seperate tables.

Like your top naviagation from your left, and content table

You have to really draw it out plan, what needs to be organized.

tedster

7:50 pm on Dec 18, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Sometimes tables are still the best answer for cross-browser purposes, especially legacy browsedrs. And sometimes it takes a mix of divs and tables. But be very wary when using both layout methods and CSS for font control.

The combination can prove to be the most volatile for NN4, and often the on-screen results mmake no sense, and can be very hard to fix. NN4 often forgets font rules after a table is closed even though it "shouldn't". It can forget that an entire page is centered and throw new paragraphs to the left, OR EVEN THE TOP!

I've found that Netscape 4 often does better in a combination layout if I wrap each table inside a pair of <div></div> tags, even though they "should" be redundant. The extra div tags seem to help the browswer remember things better.

When I'm trying to accommodate NN4, I create the page layout with NN4 open, and I do FREQUENT checks - any time I do any structural changes to the layout.

It is possible to get a working page template that serves for Netscape 4 - even if you end up sacrificing some aesthetic touches. Once you have a basic layout that works, then you can develop at a faster pace.

I'm more of a pragmatist than a purist -- I really wish that all div/CSS layouts were as flexibile and easy to work with as table based layouts. But so far, my experience is that they are not. However, I love the ideal of separating presentation rules from document structure and so I usually start with divs. A lot of the time, I can find a way to get the layout I want...but that's far from every time.