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?
>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.
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.
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 … :)
>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.
>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.
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.
> 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.
2D had some reactions :), but :
< td>how could one cell table be a table and have no layout purpose ?< /td>
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
>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.
HTML5 distinguishes between data and layout tables very specifically:
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.
You must be logged in to reply to this topic.
*May or may not contain any actual "CSS" or "Tricks".