News for hackers. Stuff that matters.
Re:Why CSS Should Be Used for Layout by jacquesm on Tuesday February 03, 2009 @03:17PM (#464576)
It took me all of 5 minutes to learn how to use tables back in oh... '94 or so, I remember the tutorial by some lady working for the fledgling netscape corporation.

To this date - and I don't think I qualify as stupid - I haven't fully grokked the css way of doing layout, there is always the little 'clear' or some other detail that keeps me from getting it right in one go. CSS works, but it is harder than it should be, the idea of something new superceding something older is that it is better and easier to use at the same time.

If CSS was really that great we wouldn't be having these debates, people would have switched en masse years ago and the 'table' tag would have been deprecated. I think any such attempt by w3c would be met with a fairly serious revolt.

Re:Why CSS Should Be Used for Layout by dasil003 on Tuesday February 03, 2009 @06:50PM (#464973)
Tables were not introduced until '95. I've been designing web pages since then and I went all CSS in 2001. If you were doing serious design things weren't quite so rosy as the picture you paint. Hobbyists and non-designers don't realize what designing with tables was really like. There were crazy idiosyncrasies like whitespace affecting table layout. The late 90s an incredible amount of effort was dumped into developing table-based layout techniques. Tools like ImageReady evolved to make slicing images easy, but the underlying code was an abomination. Depending on your design you end up having to have tiny cells with tons of rowspan and colspan attributes or deep nesting. Neither one of those is maintainable at all, and when you bring a template-based back-end it can get downright insane. And once you get to those kinds of designs, things aren't nearly so predictable as some seem to think. Try fixing the width of one column in a table and then predicting the width of each of the remaining columns. The table cell width computation varies frustratingly between browsers and the particular content in the cell. Even worse, this situation will never be resolved because all development effort towards advancing the state of web design is happening in CSS. The abilities you have today are what you will have forever, except new browsers may introduce bugs.

The problem with this debate so far is the oversimplification of the issues. CSS was not created to simplify a 5-cell table layout by turning it into 5-div layout. These degenerate examples aren't representative of the real-world design issues that gave rise to CSS in the first place. It's like somebody saying PHP is a better language than Haskell because "functional programming is confusing"--sure go for PHP if you just need to get something done, but if you are serious about the craft of programming than you need to look to the state of the art.

CSS is far from perfect. But people need to have some appreciation of the facilities it brings to the table (despite imperfect browser support). The capabilities are much richer than tables (in fact they are a superset in the spec), and designed to solve complex design issues across a range of devices and media. This is all achieved in a human readable and editable language. Try writing postscript out by hand some time.

Re:Why CSS Should Be Used for Layout by ja2ke on Tuesday February 03, 2009 @07:42PM (#465042)
I still generally code in tables, but I agree with this. The flexibility of design, and the design possibilities available to the guys in my office who use CSS, are far beyond what I can accomplish with a table or mixed table/CSS design, unless I seriously hack the shit out of my page, which makes the coders go bananas.

It's definitely a transition to go from the table mentality of basically stretching the page out like a weird balloon from the top left corner or top center of the page, to the CSS mentality of having to sort of "press in from the outside" to keep things from blowing up all over the page and each other, but the more I learn about how web stylesheets work, the more I respect them.

CSS fans often cite the fact that the code looks cleaner or that the data is more modular, etc. I don't really think that's the case, at least not when compared to a table driven site which also just has a lot of class and ID tags for background images, text colors, which in practice is just as flexible. CSS shines though where it allows you to create things in sizes and configurations just not possible in tables without a lot of shitting all over yourself (the biggest one being having two elements overlap, which is useful for drop down menus, confirmation boxes, etc, etc.)

Re:Why CSS Should Be Used for Layout by joe_the_user on Wednesday February 04, 2009 @01:36AM (#465351)
"Hobbyists and non-designers don't realize what designing with tables was really like."

Uh, designers might not realize that programmers have to generate and modified HTML, not just hand-craft it.

I do really do appreciate that Div/CSS have many, many aspects that are a step forward.

But the limitation that have been incorporated into CSS are just worse the "imperfect", they have screwed the ability to produce exact, reproducible results.

The ultimate solution is something beyond both present CSS and tables.

"Try fixing the width of one column in a table and then predicting the width of each of the remaining columns." -- Yeah, but I can predict that each item on the row will be on the same line. Divs are harder than that.

Well, we can go on but I swear I've learned something and I was a div proponent till today.

Re:Why CSS Should Be Used for Layout by dasil003 on Wednesday February 04, 2009 @03:15AM (#465440)
Uh, designers might not realize that programmers have to generate and modified HTML, not just hand-craft it.

Yes, and this is one of the areas where tables can get really nasty really quickly.

But the limitation that have been incorporated into CSS are just worse the "imperfect", they have screwed the ability to produce exact, reproducible results.

My point was that the idea that tables produce exact reproducible results is flawed. They just are more straightforward at the very basic level.

The ultimate solution is something beyond both present CSS and tables.

It's a nice thought, but god is not going to come out of the sky and simultaneously upgrade everybody to the something better.

People complain about all the flaws of CSS and the slow pace of progress, but seriously, considering this is the first truly cross-platform, cross-medium technology in the history of mankind, and looking at where we were in 5 year increments (2004, 1999, and 1994), progress is doing just fine.

Another thing... it's easy to pick apart CSS. But the domain of problems it has to address is HUGE. It's much more complicated than any one individual can fathom. No one is going to be able to turn around and create something that solves all the problems without being extraordinarily complex.

Yeah, but I can predict that each item on the row will be on the same line. Divs are harder than that.

CSS does have a learning curve, but it's not bad for what it actually provides. 90% of the hassle is just browser issues (which are getting better all the time). And FWIW, CSS supports table layout rules as well as float and absolute positioning, browser support just needs to catch up.

Re:Why CSS Should Be Used for Layout by braindead_in on Tuesday February 03, 2009 @06:53PM (#464980)
Or try learning latex!
Re:Why CSS Should Be Used for Layout by KrisJordan on Tuesday February 03, 2009 @05:11PM (#464780)
The table tag's purpose is to host tabular data. Hence the <thead>, <tfoot>, and <tbody> tags for column headers, footers, and body data respectively.

Cite: http://www.w3.org/TR/html401/struct/tables.html