News for hackers. Stuff that matters.
Re:When to use tables for layout by mbleigh on Tuesday June 17, 2008 @05:49PM (#220180)
Fair question. Semantically the <table> tag is created for just that, tabular data. If you use it for layout there are a number of problems. First, it is harder for screen-readers and other accessibility-based tools to decipher a website laid out with tables than one properly laid out using standards-based development. Second, you are adding needless bloat and confusion to your markup, as you will have completely unnecessary tags littered throughout your HTML. Third, you will be going against standards-based development, which is a worthy goal in and of itself.

CSS exists to separate markup from style information, that's its entire purpose. To use tables to lay out a page is to explicitly include style information in a place designated only for semantic markup.

Re:When to use tables for layout by dmoney on Tuesday June 17, 2008 @07:40PM (#220326)
Perhaps the solution is to make a better screen reader, one that can extract semantic data from non-semantic markup.
Re:When to use tables for layout by olavk on Wednesday June 18, 2008 @09:24AM (#220734)
Yeah, screen readers seem pretty useless if they cant handle a web page with tables-for-layout, since these are quite common whether we like it or not.

A sensible heuristic would be to treat tables without TH or THEAD elements as layout-tables, ie. just read them serially, while treating tables which contain at least one TH-element as a true semantic table. I'll bet this is the correct interpretation 9/10 times.

Re:When to use tables for layout by hobbs on Wednesday June 18, 2008 @12:41PM (#220885)
Heh. It's ironic that XML was designed to represent text documents, but is now mostly used to hold data. Maybe if they had named it eXtensible Table Language, they would have enticed people to put text into it like they do with the <table> element.
Re:When to use tables for layout by tomjen on Wednesday June 18, 2008 @12:15AM (#220515)
The <table> tag may have been designed to be used for table, but this is not what it is used for in practice. Hence screen readers should adapt.