Christian Ziebarth

Tables vs. Tables

In Uncategorized on February 3, 2009 at 6:34 pm

You’ve heard of Spy vs. Spy and Kramer vs. Kramer and Godzilla vs. Rodan. But have you ever heard of Tables vs. Tables?

I am surprised that in 2009 there are still people in the web development world who don’t understand the proper use of HTML tables.

With the economy the way it is I have a trickle of freelance web development work but still need to land a full time gig. I contact many companies about jobs they have posted but rarely get any sort of response. A few days ago I actually received a response from one company that may shed some light on what other, non-responding companies could be thinking. After this company checked my resume online they wrote back and said:

We cannot accept you as a developer because we found a TABLE tag in your markup on your page at: tccnotary.com

It did not matter to them that my site did not use HTML tables for page layout but only for presenting tabular data. All that mattered to them was that somewhere along the line they had heard the vague idea tossed about that “tables are bad” and they took that idea and ran with it without ever finding out the truth of the matter. So, basically I am losing out on job opportunities because of other people having a poor understanding of web development.

Here’s two important quotes from the official World Wide Web Consortium web page on the proper use of tables (http://www.w3.org/TR/html401/struct/tables.html). The first addresses the improper use of tables while the second ensures that there is a proper use for them:

Improper Use

“Tables should not be used purely as a means to layout document content as this may present problems when rendering to non-visual media. Additionally, when used with graphics, these tables may force users to scroll horizontally to view a table designed on a system with a larger display. To minimize these problems, authors should use style sheets to control layout rather than tables.”

Proper Use

“The HTML table model allows authors to arrange data — text, preformatted text, images, links, forms, form fields, other tables, etc. — into rows and columns of cells.”

Unfortunately, we appear to have a situation where many don’t know that a proper use for tables DOES exist and apparently those people are in charge of web development companies and are keeping better qualified people off their teams.

Further Clarification

But is that the only misunderstanding related to HTML tables? No, because even among those who realize that tables are not to be used for page layout but can be used for presenting tabular data the vast majority of them don’t know exactly what constitutes tabular data. The commonly held idea (and, yes, I have seen it expressed on the web) is that tables can only be used to present data in a way that mimics a stodgy Excel spreadsheet. So let me repeat, in list form (an irony, I know, since this entry is all about tables), what the W3C says it does allow to be presented in tables:

  • text
  • preformatted text
  • images
  • links
  • forms
  • form fields
  • other tables

Gasp! “You mean the W3C says tables can be used to present forms and form fields?” Think of the vast amount of effort that has been expended by front end web developers over the last six years or so to present web forms without resorting to laying them out with HTML tables. I have even tinkered with it myself (and I’m not saying that every form I code from now on will be laid out with a table) but I realized a few months ago that a web form is a table of data that is simply waiting for some of its data to be filled in.

Note that none of what I am saying here equals, “Web pages should be laid out using tables.” But I do think as web developers, which includes yours truly, that we need a fresh reminder of what HTML tables can actually be used for.

  1. Thank you, any article about “tables are not evil” makes me feel better.

  2. Thanks, Andrea. Yeah, it’s really about having a clear understanding of what you CAN do with them. There’s wrong ways to use them but plenty of right ways as well.

  3. Thanks for the comment, Aleksandar. I might have a followup entry later.

  4. […] talked before about how there are proper uses for HTML tables in addition to the improper use (i.e., page layout) […]

  5. > what the W3C says it does allow to be presented in tables:
    >
    > text
    > preformatted text
    > images
    > links
    > forms
    > form fields
    > other tables

    What else is there?

  6. I believe that’s the complete list. Here’s the statement from them again:

    β€œThe HTML table model allows authors to arrange data β€” text, preformatted text, images, links, forms, form fields, other tables, etc. β€” into rows and columns of cells.”

  7. Four years later, I’m still crashing into the “TABLES ARE EVIL!” mentality. I mean, really — it isn’t the BLINK tag, people!!

  8. Sorry for not seeing this until a month later. Now, the BLINK tag… that’s a different issue.

All comments are screened for appropriateness. Commenting is a privilege, not a right. Good comments will be cherished, bad comments will be deleted.