Jump to content

[SOLVED] General page layout, tables vs divs


markjoe

Recommended Posts

I have seen randomly on the web people saying "never use tables for layout!".

Trouble is they never seem to go into any reasoning. I have pages with a table-like layout with tables and some with divs. Either seem to work fine.

(actually I find that sometimes using tables is quicker and easier, mostly report-type pages)

Question is, does anybody know any actual reason(s) to not use tables for basic layout?

Keep in mind that when I use tables, it is plain table, tr, td elements with CSS (not using the deprecated attributes).

Link to comment
Share on other sites

Heres a short read from the w3c (the group that sets the web standards) http://www.w3.org/2002/03/csslayout-howto

 

If you look at the definition of what a table is from the w3c, it is to layout tabular data.  A website layout is not tabular data.  A chart showing a list of peoples name, age, phone, etc. IS tabular data.  If you layout a website using a table, you are not following web standards and many companies want (obviously) to follow standards because it is a reflection of the company.

Link to comment
Share on other sites

The real problem with a table based layout is that the order in which your content is provided to a screen reader, search crawler, etc. is different than with a pure CSS layout using divs. You know that you can float, and use absolute positioning with CSS and divs, and this is a good thing because you can put your real content at the top of your document (even if it appears lower on screen).

 

Take a look at my website with all style turned off, or with images turned off, or both. The content that exists behind the style and images is what makes the page what it is.

Link to comment
Share on other sites

Thanks for the info. I guess in most cases I am using tables and divs correctly then, other than that one index page I don't want to re-do.

I do sometimes have a tendancy to fall back on tables rather quickly when I have I don't get the results I want in CSS right away (hangs head in shame).

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.