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

>These are the kind of people (I kid you not) that think HTML tables are a great way to get your page layout just right.

Is there are good replacement for HTML tables yet that works well in all browsers?

I'm talking about for things that actually need to be laid out in a grid, which, in my experience, is many things. Grids are fairly fundamental to layout and design.



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://960.gs/ http://html5boilerplate.com/ http://www.initializr.com/ http://codekickoff.com/


Tables 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://www.blueprintcss.org/

http://developer.yahoo.com/yui/grids/

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.


There 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.


It'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.


Because 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.


Look at http://960.gs/ to see some examples of stuff that is done, cross-browser, with a CSS grid framework and without tables.


These frameworks all use pixels. If you're developing a mobile app you need percentage based layouts because you must use the entire screen or the experience will suck. Luckily most mobile browsers support flexbox which seems to work relatively well.


True. I don't use 960.gs personally, it just has some good examples (I tend to use compass+susy, but flexbox looks better for mobile).


Using `display: table` is a great way to lay out your elements in a grid while keeping your HTML semantic.


who said tables aren't semantic? Tables say "Hey, I'm going to show you some things with a row column relationship now." Some times table is exactly the semantics you need. It shouldn't be your primary and only tool but if your showing a set of numbers collated and sorted by rows and columns then its pretty much semantically a perfect fit.


I see this argument a lot. You're right, there are situations where tables are semantic. But unless otherwise stated, it's fair to assume that someone who's talking about semantic markup knows that semantic markup includes tables, but simply discourages them for 99% of layout purposes.


No good if you care about IE6 support


Unless you have a boss telling you to support IE6, you don't. People need to stop using this prehistoric excuse for a browser.


As you said, some people work at companies that mandate its use - they have no choice. While that's happening, it needs to be considered.


If by no longer supporting IE6 we can force these companies to finally go with the times, then by all means, no, we should not consider this. We cannot endlessly cater to every outdated technology ever.

Besides, these companies have absolutely zero valid reasons to keep using this crutch - it's severely outdated, a giant gaping security hole and a hindrance to the entire world wide web.

And no, legacy applications built upon IE6 on which some corporations have based their entire internal communication (or other things) are not an argument for supporting IE6, but instead gives us all the more reason to force them to get rid of it.




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

Search: