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

As far as I know, there's some holy war against <table>s going on, so people rather write tons of obscure CSS code, which becomes instantly impossible to understand the moment you write it and probably renders 10 times as slow in any browser, than to just use tables.


I had to do a double take on your comment because that holy war ended a very long time ago and with very good reasons.

Here's a pretty good summary: http://stackoverflow.com/questions/83073/why-not-use-tables-...


The responses that use valid arguments (i.e. not "it will harm your professional reputation to use tables! or tables are for tabular data! or I can bill more hours if I use CSS!") pretty much agree that the arguments against tables don't hold much water.

The only argument that might be important against tables that I could see is that they work less well with screenreaders. Can anyone using a screen reader confirm or deny this? I could easily see it being the other way around, because with tables a screen reader will let you quickly navigate to different parts of the page (e.g. sidebar to header to main content by going left, right, up and down instead of painstakingly navigating over a bunch of text).

On the other hand, tables are easier to use, more flexible, more predictable across browsers, and more readable. Just look at the years and years of research it took the CSS experts at e.g. Alistapart to replicate layouts that are trivial with tables using CSS.

Examples:

http://www.alistapart.com/articles/fauxcolumns/

http://www.alistapart.com/articles/fauxabsolutepositioning/

http://www.alistapart.com/articles/multicolumnlayouts/

http://www.alistapart.com/articles/negativemargins/

And even then it doesn't always work: http://www.satzansatz.de/cssd/hgjump.html

Note that these layouts are utterly trivial to create with tables.


They also don't work very well if you're trying to build a site that looks decent on a mobile browser... You can do some cool CSS tricks to facilitate different screen sizes. See http://cssgrid.net/ for an example (resize your browser window and see how things change)


I think of tables as a shortcut and they do cause actual problems in the future even if they work for you. I think the bigger issue here is that it isn't clear to everyone how to code with CSS. I use tables only for tabular data but my HTML is clean, fast and certainly not obscure. I would say in most cases I can create an tableless design in less lines of code and have a much easier time maintaining or updating it in the future.




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

Search: