Grow your CSS skills. Land your dream job.

Are tables a bad thing?

  • # July 16, 2013 at 1:17 am

    I don’t use them often, but I have never been *scared* of using tables. Yet, I seem to run into a lot of “purists” on the internet that are under the impression that tables should **never** be used under any circumstances.

    Should I try to avoid tables at all costs? Or are they okay to use in CMS type settings or when I need to vertically center an element?

    # July 16, 2013 at 1:52 am

    They should only ever be used for what they were intended for in the first place, tabular data. And even then there’s other better alternatives for modern browsers.

    # July 16, 2013 at 1:58 am

    Yeah, tables for tabular data.

    A “purist” say no tables whatsoever is equal to another “purist” saying no floating whatsoever. There’s obviously just a lack of understanding on their side.

    # July 16, 2013 at 4:55 am

    >They should only ever be used for what they were intended for in the first place, tabular data.

    True

    >And even then there’s other better alternatives for modern browsers.

    Not entirely sure I agree with you here….alternatives, yes but **better** I’m not sure about that.

    They all have their drawbacks and are, at best, merely trying to replicate table functionality &/or are more mark-up intensive.

    # July 16, 2013 at 6:46 am

    No, tables are not a bad thing

    they have a purpose and most of the time are not enough well formed/used (thead, summary, col, caption and so …).

    Some says , table should not be used for latyout , okay , unless your content is tabular-data … readable in 2D in other words.

    Somehow a table of one, or even two, cells is not a table. There is not enough data for it to be read as so.

    The best to advice should be: Learn how to build and handle a table and then you’ll know if your datas needs it.

    One cell table can only do layout

    hmm , maybe i should have not post that one … :)

    __
    # July 16, 2013 at 11:27 am

    >Some says , table should not be used for latyout , okay , unless your content is tabular-data … readable in 2D in other words.

    “tabular data” does not mean “readable in 2D.” It means a collection of related information organized in logical rows and columns. The whole point of the debate is that, with tables, the “grid” format is _incidental_.

    The question you need to ask is if it makes sense to group the contents of each cell under the particular headings of the column, and with the contents of the other cells in the same row.

    If your columns don’t have headings (and you find it difficult to come up with headings that make sense), then it’s a very good indication that your data doesn’t belong in a table.

    # July 16, 2013 at 12:00 pm

    Think of it this way. Do you have an info that would be best to display in a Excel spreadsheet? If yes, than you know what to do.

    # July 16, 2013 at 12:01 pm

    > Think of it this way. Do you have an info that would be best to display in a Excel spreadsheet? If yes, than you know what to do. @jurotek

    hahaha I do that a lot, though it’s not applicable in *every* situation. It’s a good way to explain it to people, though.

    __
    # July 16, 2013 at 3:37 pm

    >hahaha I do that a lot, though it’s not applicable in every situation.

    Actually (and I don’t remember where I read it – I think it was on joelonsoftware, but I can’t find it now), the first time MS sent people out to see what features customers found useful in Excel, they discovered that most of them were using it primarily as a grid-layout tool.

    # July 16, 2013 at 10:18 pm

    That’s funny. You know what I used Excel for a lot in the past. To set up entire DB Schema with objects like text boxes and lines with arrows for relationships. After I was sure that everything was in place, that the right dependencies and relationships were established, and it conformed to 3NF and user reporting requirement needs then I developed it. Still remember how some shook their heads but it worked for me.

    # July 17, 2013 at 3:38 am

    > Should I try to avoid tables at all costs? Or are they okay to use in CMS type settings or when I need to vertically center an element?

    HTML tables are meant to display tabular data. When you have lot of data that can be ordered in rows and columns (Excel style), the best way is still to use tables. What we don’t do anymore is using tables for layout.

    # July 17, 2013 at 10:08 pm

    Why people are so paranoid with tables? Tables isn’t bad. Tables will be bad only when used in improper conditions. If you want to create web layout, don’t use `

    `, but if you want to create table, feel free to use the `
    `.
    # July 18, 2013 at 4:33 am

    2D had some reactions :), but :

    < html>
    < body>
    < table>
    < tr>
    < td>how could one cell table be a table and have no layout purpose ?< /td>
    < /tr>
    < /table>
    < /body>
    < /html>

    did not :)

    Where style do not work , it makes it solid and makes no doubts about content, … mailing for instance ?

    Once , it was said not to use hundreds of span nor div

    __
    # July 18, 2013 at 10:41 am

    >how could one cell table be a table and have no layout purpose ?

    why couldn’t it?

    >Where style do not work , it makes it solid and makes no doubts about content, … mailing for instance

    emails are a use case, yes. That’s not an “exception” to the rule, however, just a practical concession.

    # July 18, 2013 at 12:15 pm

    HTML5 distinguishes between data and layout tables very specifically:

    http://www.w3.org/TR/html5/tabular-data.html#the-table-element

    Tables should not be used as layout aids. Historically, many Web authors have tables in HTML as a way to control their page layout making it difficult to extract tabular data from such documents. In particular, users of accessibility tools, like screen readers, are likely to find it very difficult to navigate pages with tables used for layout. If a table is to be used for layout it must be marked with the attribute role=”presentation” for a user agent to properly represent the table to an assistive technology and to properly convey the intent of the author to tools that wish to extract tabular data from the document.

    More details are available at the W3C website above.

Viewing 15 posts - 1 through 15 (of 16 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".