Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> In a modern web world it is extremely inappropriate to use tables for non-tabular data [even when convenient]

Why?



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.


Perhaps the solution is to make a better screen reader, one that can extract semantic data from non-semantic markup.


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.


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.


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.


Bate taken. Because it violates the semantics of what a table should be. i.e. a data matrix.


I don't care what a table "should" be very much. How is that even determined? By what some committee says? I care what, in fact, it does. How browsers and others use it.


Yes by a committee... and it's the lack of following W3C standards in the late 90's and early 00's that has created such a headache for web developers today. For example if IE5/IE6 played nice, we could spend more time building out sweet functionality and less time bug-fixing.

It's ok to be a conformist in this regard.


Of course you can always do what ever you want/what ever works. But the reality is moving away from tables for your layout will make your site more malleable and easy to maintain the future. It doesn't always mean crazy i.e. only clauses in your css either. see: http://news.ycombinator.com/item?id=219809


but didn't the article give an example or two where tables made your site more maintainable?


Tables give you abritary grids, a very important design tool. CSS doesn't do as well. People turn to CSS frameworks to make it happen.


No, that was not my interpretation of this article at all. It sounds to me like you've never built a large CSS/XHTML valid website, or you'd understand why the web is driving toward standards.

I was like you ~3-4 years ago as I grew up using tables. Believe me, just move on... 99% of the job postings I see require an understanding of XHTML/CSS. And this trend will continue as standards are solidified...

Catch up or be left behind.


The point of the article is to show how table-based layouts in some specific circumstances are more maintainable than pure-CSS layout. If you disagree with this, it would be interesting to hear your counterpoints.


It's called a table, not a grid. And as information and the internet enlarge (hence the continuous drive for better search), semantics are a very important aspect of the equation. As such, so is using proper markup to define the content of the page.

Your post does not constitute more "maintainable" code at all, and contradicts the years of community contributions to CSSZenGarden. I'd recommend you establish a personal CSS "framework" for tackling common layouts/frustrations.


How would you specifically solve the form-in-a-grid layout problem described in the article?


sounds to me like you've never built a sizable web application.


I've been in the business since the late 90's my friend, and for a significant portion of that time on the side of front-end design and production. I didn't mean anything negative by calling out his inexperience with XHTML/CSS, but after reading through his rebuttal it was the only logical conclusion.

Unlike you, I clicked on your profile and read a vast majority of your comments. You should go back to lurking, and spew your negativity and snide remarks elsewhere...


oh i didn't mean anything negative either. it was just ... the logical conclusion.

unlike you, i have no interest in your profile.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: