4 ms·
This article is missing the point...it is merely talking about when it is CONVENIENT to use tables for layout, not when one SHOULD use tables for layout. In a m
by mbleigh 18y ago
This article is missing the point...it is merely talking about when it is CONVENIENT to use tables for layout, not when one SHOULD use tables for layout. In a modern web world it is extremely inappropriate to use tables for non-tabular data. Yes, this means that oftentimes there will be messy CSS hacks to bring Internet Explorer into submission, but any designer/developer worth his/her salt is old hat at such tricks by now.
The proper time to use tables for layout is when one is laying out out a table. If you aren't, then you are simply performing a cop-out maneuver to save yourself time in website development. If that's what you want to do, do it, but don't call it something it's not. Just because it's easier doesn't mean it's better.
- xlnt 18y ago> In a modern web world it is extremely inappropriate to use tables for non-tabular data [even when convenient] Why?
- mbleigh 18y agoFair 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.
- dmoney 18y agoPerhaps the solution is to make a better screen reader, one that can extract semantic data from non-semantic markup.
- olavk 18y agoYeah, 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.
- tomjen 18y agoThe <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.
- hobbs 18y agoHeh. 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.
- shaunxcode 18y agoBate taken. Because it violates the semantics of what a table should be. i.e. a data matrix.
- xlnt 18y agoI 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.
- shaunxcode 18y agoOf 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 http://news.ycombinator.com/item?id=219809
- xlnt 18y agobut didn't the article give an example or two where tables made your site more maintainable?
- elai 18y agoTables give you abritary grids, a very important design tool. CSS doesn't do as well. People turn to CSS frameworks to make it happen.
- pxlpshr 18y agoNo, 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.
- edw519 18y agoit is extremely inappropriate to use tables for non-tabular data Oh no, you mean everything I've read here in the last 482 days has been displayed in "extremely inappropriate" mode?
- ajross 18y agoAmen. This is one of those pedantries that has outlived its justification. Look: can tables be misused? Yes. Have they been? Yes. Does a static HTML file filled with tables for layout obscure the semantics for things like screen-readers? Sure. Does any of that have anything to do with whether or not a table should be used for layout? Not that I can see. Two or three lines of jQuery will pack those divs into your table by class. The weirdest part of all of this is the idea that CSS is "just as good" for typical layout tasks. Not only is it not as good, it's a near-disaster. Nothing works right, ever. It's never possible to just say "line these elements up and put these others to their side" without jumping through awful hoops. Seriously: look at the "layout" CSS for any serious site and it's almost unreadable. GUI developers have understood this for two decades now, and universally settled on the table as the appropriate layout mechanism. Why the web should somehow be different just baffles me.
- pxlpshr 18y agoI absolutely love Flex's layout system and it's not table based.
- irrelative 18y agoAgain, I find myself agreeing with you :-) People seem to think that if you create CSS based layouts, that they can be repositioned and re-done using only CSS. This is simply incorrect, and anyone with sufficient html experience knows this. If you want to change the layout of any site, you need access to both the html and the CSS, so trying to separate the two is just overkill. Sure, you'll want to use CSS for colors and fonts, but for page flow, CSS isn't powerful enough by itself.
- pxlpshr 18y ago
- staunch 18y ago> In a modern web world it is extremely inappropriate to use tables for non-tabular data. Someone once said (in an admittedly totally different context) that '"Inappropriate" is the null criticism. It's merely the adjective form of "I don't like it."'
- icey 18y agoIf tables were good enough for Viaweb in 1995, then they're good enough for the rest of us in 108.
- Hexstream 18y agoPretty lame "argument", especially considering how much goes on in 13 years in the computing world. Let's see: If Windows 95 was good enough for most people in 1995, then it's good enough for the rest of us in 2008.
- deleted 18y ago[deleted]
- anirbas 18y agoI read that message as sarcastic, for just that reason.
- ibsulon 18y agoThat's 19108 to you, mister!