3 ms·
Tables are for tabular data. You wouldn't use a spreadsheet to design a web page so by the same token a table is just as unsuitable. CSS support is a lot bette
by FuzzyDunlop 15y ago
Tables are for tabular data. You wouldn't use a spreadsheet to design a web page so by the same token a table is just as unsuitable.
CSS support is a lot better and more consistent across browsers now than it was even just a year ago, and there are CSS 'frameworks' that make grid based design a trivial task without cluttering your page with table markup where it's not required.
There are even plenty HTML5 'frameworks' (or templates if you prefer) that take backwards compatibility and such like into account so you don't have to faff about with all that yourself.
http://www.blueprintcss.org/ http://www.blueprintcss.org/
http://960.gs/ http://960.gs/
http://html5boilerplate.com/ http://html5boilerplate.com/
http://www.initializr.com/ http://www.initializr.com/
http://codekickoff.com/ http://codekickoff.com/
- deleted 15y ago[deleted]
- speleding 15y agoThere are situations when a table based layout just works better. Have you ever designed a site that needs to work with right-to-left text (Arabic / Hebrew) as well as English? If you use tables for your layout a simple 'html {direction:rtl}' fixes everything. If you are doing it the "right" way then you have to reverse every float and margin settings from right to left and vice versa. A nightmare to maintain. Clearly the CSS designers did not have that use case in mind.
- webnrrd2k 15y agoIt's a mystery to me why the standards bodies didn't just take the code for tables and make an copy of it, just using a new name like "grid" or "layout" or something.
- eurleif 15y agoBecause HTML is for expressing semantics, not presentation. If you want something that displays like a table, but isn't, you can do that with CSS using display: table.
- nl 15y agoTables are for tabular data. I'm going to rant now. It think it is ridiculous that people get away with stating that one shouldn't use tables for layout because "Tables are for tabular data". What is a table? It's a grid! And grid-based CSS layout frameworks are the new hotness; eg: http://960.gs/ http://960.gs/ http://www.blueprintcss.org/ http://www.blueprintcss.org/ http://developer.yahoo.com/yui/grids/ http://developer.yahoo.com/yui/grids/ http://www.w3.org/TR/css3-grid-layout/ http://www.w3.org/TR/css3-grid-layout/ (And look! Many of these are exactly what you listed!) CSS has many wonderful features. However, I think the "tables are for tabular data" is an intellectually lazy argument that needs to die. CSS should be used because of what it can do for you - not because of some theoretical argument about the purity of tags.