7 ms·
I also find it crazy how there was a huge campaign to remove use of the table tag for layout. 'It's non semantic! You're mixing layout and content!' people woul
by supercoder 11y ago
I also find it crazy how there was a huge campaign to remove use of the table tag for layout. 'It's non semantic! You're mixing layout and content!' people would cry over and over.
.. But then we've ended up with bootstrap and it's grid layout, where we're doing exactly that, and for some reason it's perfectly fine.
- cyphunk 11y agoand I wonder how the <ul><li> somehow survived unscathed and free from the semantic witch hunt of yore. shouldn't we replace them with: <div style="display:list-type; type-of-list:unordered"> <div style="display:list-item;"> ?
- lucideer 11y agoThis comment doesn't make any sense. A list is a thing, just as a table is... What are you trying to say?
- tjic 11y agoDown vote for "doesn't make sense". It made perfect sense to me. The phrase you were looking for is " I don't understand what you're saying."
- wtallis 11y agoThen perhaps you would like to explain it? The most meaningful interpretation I can see is that the commenter completely misunderstood the nature of the "semantic witch hunt" to which he referred. It seems charitable to assume that something was lost in translation and to ask for clarification rather than to assume that the commenter was just saying something stupid.
- exodust 11y agoVery true, and such charity doesn't help the discussion. Insisting on the polite path, "I don't understand" instead of "your comment makes no sense" wrongly assumes that all comments written on forums are carefully considered and fact-checked before posting. It's taking the long way to resolution of that point, and you might never get resolution if bogged down in overly-polite discourse for fear of being "negative".
- nness 11y agoThe phrase the poster was looking for was that "the example provided was hyperbole." Your comment is far too confrontational.
- danellis 11y agoIf you go down that path, there are no semantic elements left at all.
- baddox 11y agoThe "semantic witch hunt" against using tables for page layout exists not because the table tag is a semantic tag, but rather because pages are not tables. Likewise, ul and li tags are semantic, and I think most people would advise against using them for something other than unordered lists and list items. Of course, the issue would probably come up rarely, since the browser stylesheets for those tags don't do anything particularly useful for anything other than lists and list items.
- lucideer 11y agoThe objection to tables for layout was never on the basis of grid layouts being bad, it was on the basis of separation of concerns. The primary problem with layout tables was that they involved tightly coupled inlining of your layout rules.
- cyphunk 11y agoI have not found a project yet that I could divorce the layout from the content without the use of javascript. i gave css many attempts at this. mainly from the desire to make the content easy to manage for others. or just for aesthetics. but css was (is) too clunky to make that separation. yet people still argue that not limiting yourself to what css can provide you, thereby giving up on the purity of content vs layout separation debate, is somehow blind use of web standards. i've since assumed css's goal was lofty from the start.
- SquareWheel 11y agoI'd agree it's not completely divorced, but it's much, much better than it used to be. If you've worked in environments where the only access you have is CSS (for instance, locked down CMSes, or editing subreddits), you'll find that many solutions are possible without manipulating HTML. CSS can be very powerful; especially with the advanced selectors of CSS3.
- encoderer 11y agoThis owes at least in part to the fact that tables are not optimized for page layout. And that was especially true 10 years ago. Popular browsers couldn't render partial tables, and you had even more performance problems nesting them. Grid based layouts are obviously useful but the table tag isn't the right tool.
- pcwalton 11y agoThe problem with tables for layout is that the layout algorithm is incredibly complex. People seem to think it's simple, because it kinda does the "right thing" in many cases, but it's actually ill-defined, varies between browsers, and has only a work-in-progress spec [1]. Width calculation is defined in terms of linear interpolation between the closest of four "candidate guesses" which bound the available width. And that's the simple case, when no colspans are involved; check the WIP spec for details on the recurring sequence that is involved when there are column spans… Regardless of how you feel about CSS 2.1, it's indisputably better than the table-based layout we had before. Speaking as someone who has implemented both table-based layout and CSS 2.1, it's really unfortunate to see people want to return to the bad old world. [1]: http://dbaron.org/css/intrinsic/ http://dbaron.org/css/intrinsic/
- nikanj 11y agoA basic rule of universe is that complexity remains, you can merely shift it around. The table layout algorithm might be incredibly complex, but I'd rather have a browser writer have the headaches than me.
- pcwalton 11y ago> The table layout algorithm might be incredibly complex, but I'd rather have a browser writer have the headaches than me. Completely disagree. The Unix philosophy is right when it comes to layout: you want to be simple, fast, and predictable. This attitude is also why we are in a situation where the Web is slow compared to native platforms. Simple things tend to be fast things. Complex things tend to be slow things.
- TeMPOraL 11y agoAnd the things you do to properly align stuff in CSS are anything but simple. You took the complexity from the place where it could be well-defined and heavily optimized and have it to the hands of every developer to do it in their own, broken way.
- pcurve 11y agoI agree and it really bothers me that all the markups in modern web pages are littered with COL, span, md, lg, xg, 1/2 2/3, with gibberish nestings. Semantic web went out the window, in favor of responsive web. The whole web is fad-driven, so I'm glad at some point, pendulum will swing back. Meanwhile, I'm just happy parallax fad is dying out.
- RobertKerans 11y agoAllowing an arbitrary website to work on a phone isn't really a fad, though. In a few years time, there's not going be a huge sigh of relief as everyone gets back the fixed-width websites they've been crying out for.
- pcurve 11y ago"Allowing an arbitrary website to work on a phone isn't really a fad, though." Agreed, but current implementation is mostly terrible, with 6 break points, 1-2MB downloads, everything = single page app, etc. So the concept of write-once, run everywhere is not a fad, but the implementation is very fad-driven.
- RobertKerans 11y agoAh, that's fair enough; I was thinking at a more conceptual (or even just CSS rather than JS) level.
- lisa_henderson 11y agoThank you for saying that. The last 15 years have seen tremendous heat and noise exhausted in fantastical debates the end result of which brings no obvious improvement. If we were honest, we would say something humble, such as "Sir Tim Berners-Lee is a great genius, and we are all grateful for what he gave us in 1989, however, since that time, we have learned many things, and the technologies proposed then did not give us what we actually need. HTML strains to fulfill two discordant goals, one is to give us structured documents, and the other is to give us a GUI for TCP/IP. But we now realize these two goals would be better served by two separate technologies, and HTML should be retired."
- TeMPOraL 11y ago> But we now realize these two goals would be better served by two separate technologies, and HTML should be retired." This. And the confusion around those two goals is what drives a lot of useless arguments with people who have Stockholm syndrome towards HTML and CSS. Those arguments can often be summarized like this: - Hey, we're complicating things too much, how about just focusing on rendering a text communicating a message? - No no no, the web is not just about documents, it's so much more now! It's about applications. - Ok then, so let's drop the nonsense about separation of concerns, that you can have layouts separate from content. - No no no, HTML is for describing documents, and CSS is for describing its layout!
- emitstop 11y agoJust starting to realize how out of touch HN readers are with CSS. This mindset does not belong in a conversation about CSS in 2015.
- acjohnson55 11y agoYou can use semantically meaningful class names and use the mixins from the Bootstrap source. Even though it's probably common practice and great for you know, bootstrapping, I don't think it's good for maintainability to leave the column classes in the markup. In a large, modular, front-end heavy project, proper separation of content, presentation, and other cross-cutting concerns really pays.
- EdiX 11y agoOpen up any webpage and count how many divs with no other purpose but to serve as CSS anchors there are. We traded in non-sematic tables for non-sematic divs.
- rimantas 11y agoExcept that div have no semantics by definition.
- nness 11y agoThe <div> element has no semantic meaning, screen-readers don't read them and they have no intrinsic behaviour unless associated with an aria tag.
- im3w1l 11y agoWhy couldn't we just have made non-semantic tables? In addition to the semantic tables, I mean.
- bonzini 11y agoDivs with display:table/table-row/table-cell _are_ non-semantic tables.
- e98cuenc 11y agoexcept divs lack colspan
- welly 11y agoThere's (almost) always a way round a problem. In the case of colspan, try this: http://jsfiddle.net/5cUW7/8/ http://jsfiddle.net/5cUW7/8/
- Springtime 11y agoI came across this issue recently and was surprised after all these years there still isn't colspan support. Ended up having to create additional containers when I should be able to style it using CSS.
- bct 11y agoBrowsers should e.g. allow tables to be sorted by clicking column headers. They can't, because tables aren't always tables.
- BonoboBoner 11y agoHow about an opt-in attribute to enable ordering then? <table sortable >...</table>
- tomjen3 11y agoKinda. I used to agree with you for the longest time, but I can relatively easily make a CSS bootstrap page responsive, because I can override the bootstrap CSS, but there is no way to override the behaviour of <table>.
- samspot 11y agoTables nested in tables nested in tables was a fate worse than divs. Even in the simplest case (one box) a table stinks: <table><tr><td></td></tr></table>. I personally found that trying to debug which table a <td> belonged to was hell on earth.