Live data from Hacker News

Why CSS Should Be Used for Layout

newmediacampaigns.com

51–58 of 58 posts

Re: Why CSS Should Be Used for Layout

#51
post #25

Earlier quoted context omitted.

My mind has change! I was Div-only and now I think mixing Tables and Div can be good, even preferable. "One of the problems with criticising CSS is that it's very hard to write good CSS, so pointing out problems with CSS begs the question of whether this is an indictment of CSS or one's coding ability. The problem is particularly pernicious for layout. (One indication of this is how many CSS layout tutorials there ar…

It changed my mind too. As for only now realising that tables really are the only easy way to do it, I guess partly we've come to accept that the web is broken thanks to IE, so it doesn't stand out as odd that layout is hard with CSS.

I would like to also say that the failure of CSS/Div is kind-of discouraging. Within the history of html, tables were intended for tabular data. The ideal of divs is to have an element that is specific to layout rather a tag for tabular data that one just happens to use for tabular.

Html, in general, is a messy. Html is one of the most amazing programming success stories, in the sense that it is the widely programming language by non-programmers. SIMPLE html created the web. Html that is that was so simple that the friggin w3c standards would never accept it now.

And the "progress of standards" has essentially only made this mircle lousier. You could blame corporations but it really seems like simple bureaucracy was just as much to blame.

Re: Why CSS Should Be Used for Layout

#52

Earlier quoted context omitted.

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 b…

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 develop…

"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

#53

Earlier quoted context omitted.

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 develop…

"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,…

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

#54
post #28

The CSS/Table argument has been settled, and tables won (by absorption): http://www.w3.org/TR/CSS21/tables.html The CSS standard has already conceded the point that tables can do things that pre-table CSS couldn't do. It's over. The pro-CSS side, at least in the way it is being argued (as if the IE subset is CSS, rather than the standard), is just wrong and totally out of date. They've been abandoned by CSS itself. Q…

There is this strange myth that "the pro-CSS side" is somehow against tabular or grid-based layouts, or believe that this kind of layout should only be used for "tabular data". That is a fundamental misunderstanding.

Note that CSS does not say that disply:table is only for tabluar data. The whole point of CSS is that you can use it any way you like, since it doesn't change the semantics of the document. This is totally different from HTML which indeed states that HTML tables should only be used for tabular data.

CSS has not "conceded" anything by including display:table - rather this is the whole point of CSS: to allow you to use grid-like layouts for other things than just tabular data.

Re: Why CSS Should Be Used for Layout

#55
post #14

Earlier quoted context omitted.

It's not about the learning curve. In my view, it's about the productivity of competent web developers and designers. Referring to the learning curve is just repeating the disputed claim that people who deny the suitability of CSS for layout are just invariably incompetent. That's an excuse. And I don't agree with ejs. I think it's an important debate because CSS layout problems are a major reason why so many people…

You could look at the html source of csszengarden. I'm guessing it uses a bit less markup and is a bit more readable than an equivalent table based layout. CssZenGarden also shows that refactoring a CSS-driven site is easier since you can do it without changing your templates.

To be so CSS-styleable, CSS Zen Garden uses multiple layers of DIV in DIV in DIV all over the place. Hardly better than table. Also this gem:

      
      

Re: Why CSS Should Be Used for Layout

#56
post #54
post #28

The CSS/Table argument has been settled, and tables won (by absorption): http://www.w3.org/TR/CSS21/tables.html The CSS standard has already conceded the point that tables can do things that pre-table CSS couldn't do. It's over. The pro-CSS side, at least in the way it is being argued (as if the IE subset is CSS, rather than the standard), is just wrong and totally out of date. They've been abandoned by CSS itself. Q…

There is this strange myth that "the pro-CSS side" is somehow against tabular or grid-based layouts, or believe that this kind of layout should only be used for "tabular data". That is a fundamental misunderstanding. Note that CSS does not say that disply:table is only for tabluar data. The whole point of CSS is that you can use it any way you like, since it doesn't change the semantics of the document. This is total…

"There is this strange myth that "the pro-CSS side" is somehow against tabular or grid-based layouts, or believe that this kind of layout should only be used for "tabular data". That is a fundamental misunderstanding."

I agree with you... except it is not a myth. There are tons of people walking around and spouting off who have come to believe that "Tables are evil!"

People with considered opinions like you are not in the majority of those speaking.

"Note that CSS does not say that disply:table is only for tabluar data."

It says "Table layout can be used to represent tabular relationships between data." Direct quote, and skimming that page, it's the only normative comment about what it is for. I again agree that CSS doesn't forbid the use in layout, but there definitely are people thinking tabular layouts are forbidden and that only the "IE subset" (again, my best guess at what incoherent thing these people are arguing for) is "pure".

You basically re-iterated my point, but I assure you that you are wrong about what other people think. Go check out the parallel /r/programming post.

Re: Why CSS Should Be Used for Layout

#58
post #56
post #54

Earlier quoted context omitted.

There is this strange myth that "the pro-CSS side" is somehow against tabular or grid-based layouts, or believe that this kind of layout should only be used for "tabular data". That is a fundamental misunderstanding. Note that CSS does not say that disply:table is only for tabluar data. The whole point of CSS is that you can use it any way you like, since it doesn't change the semantics of the document. This is total…

"There is this strange myth that "the pro-CSS side" is somehow against tabular or grid-based layouts, or believe that this kind of layout should only be used for "tabular data". That is a fundamental misunderstanding." I agree with you... except it is not a myth. There are tons of people walking around and spouting off who have come to believe that "Tables are evil!" People with considered opinions like you are not i…

I think when people say "tables are evil" they really mean "HTML-table markup used for purely presentational purposes are not ideal." But maybe you are right.

Anyway, I agree we are in agreement, except I don't think the quote from CSS2 you mention is normative. (It says can be used, not must be used or should be used) It is just an example. There is nothing normative in CSS about when to use the different styles.

Post reply on HN