Live data from Hacker News

CSS Grid – Table layout is back. Be there and be square

developers.google.com

131–140 of 280 posts

Re: CSS Grid – Table layout is back. Be there and be square

#131

I don't know how to say it politely but what has been achieved by using ad-hoc syntax such as this gem (and similar complex CSS syntax): display: grid; grid-template-rows: 150px [nav-start] auto 100px [nav-end]; grid-template-columns: [header-start] minmax(200px, 3fr) 9fr [header-end]; CSS fans for some reason seem to think that its somehow better to have rendering/presentational properties in an ad-hoc language. Ori…

I'm glad someone else said it. I particularly like that they've introduced a new unit, `fr`, and can't even decide what it stands for.

I've been writing CSS since about 1996; for some reason, I feel like it all started to go downhill, fast, with the background gradient syntax.

Re: CSS Grid – Table layout is back. Be there and be square

#132
post #129
post #39

Earlier quoted context omitted.

What, exactly, is the problem with the tag in the first place? Been a long, long time since I last touched HTML

Nothing. But tables are for tabular data. Laying out a page using a table to divide it up and make it look pretty (or in lots of cases, lay it out so it performs some kind of sales based task) doesn't make much sense. Hence the preferred CSS route, even if the markup is just as verbose (as mentioned in this thread). Web apps aside [sigh], if one was to disable CSS (and thus all the blocks making it look pretty), the…

But why is that beneficial?

Re: CSS Grid – Table layout is back. Be there and be square

#133

I don't know how to say it politely but what has been achieved by using ad-hoc syntax such as this gem (and similar complex CSS syntax): display: grid; grid-template-rows: 150px [nav-start] auto 100px [nav-end]; grid-template-columns: [header-start] minmax(200px, 3fr) 9fr [header-end]; CSS fans for some reason seem to think that its somehow better to have rendering/presentational properties in an ad-hoc language. Ori…

I agree plus the "there's more than one way to do it" motto is dangerous. There is a reason everyone dropped Perl. It was self obfuscating. And these constructs are so opaque that they don't even know the name of their own 'fr' unit.

Re: CSS Grid – Table layout is back. Be there and be square

#134

Earlier quoted context omitted.

The (theoretical) issue here is that a "table" has a certain semantic meaning ("a container for tabular data"), and that using a table for something outside that semantic meaning can introduce confusion, be it for fellow programmers (including your future self!) or for those who are interpreting your page in weird ways (robots, people using screen readers, etc.). In the few times I actually bother with frontend "desi…

OK, so tables have semantics of tabular data. But the shit ton of semantically meaningless divs that are sprinkled around the structure to provide hooks for CSS declarations in the "usual" style of doing layouts is somehow better? It's much larger, much less readable, much less obvious, and breaks the "separation of content and layout" rule even stronger than tables. So again, why is this better? And yes, I've been i…

I feel like this is the reason behind HTML5's semantic elements (e.g. article, nav, etc).

Re: CSS Grid – Table layout is back. Be there and be square

#135

Earlier quoted context omitted.

Since you included the element in your list, something I wish browsers provided is a way to automatically format time elements based on user's preferences. I just want to provide the value in ISO8601, and let the browser take care of it. Luckily, Intl.DateTimeFormat [0] seems to finally allow a reasonable degree of i18n in the browser. If you can live with the limited Safari availability, of course. [0] https://devel…

>something I wish browsers provided is a way to automatically format time elements based on user's preferences That'd quickly get awkward. I live in Norway where the default format is DD/MM as opposed to MM/DD used in the US. This works fine for us in general, we know to expect the first one when we read something in Norwegian and the second one when we read something in English. If a computer formatted a date based…

You already have that problem, whether or not you were aware of it. Many (most?) English speaking countries use DD/MM.

Re: CSS Grid – Table layout is back. Be there and be square

#136

Earlier quoted context omitted.

The (theoretical) issue here is that a "table" has a certain semantic meaning ("a container for tabular data"), and that using a table for something outside that semantic meaning can introduce confusion, be it for fellow programmers (including your future self!) or for those who are interpreting your page in weird ways (robots, people using screen readers, etc.). In the few times I actually bother with frontend "desi…

OK, so tables have semantics of tabular data. But the shit ton of semantically meaningless divs that are sprinkled around the structure to provide hooks for CSS declarations in the "usual" style of doing layouts is somehow better? It's much larger, much less readable, much less obvious, and breaks the "separation of content and layout" rule even stronger than tables. So again, why is this better? And yes, I've been i…

Using an element that lacks semantics () is always better than mis-using an element that has semantics (, ). Why would you need to use more divs than table elements to achieve the same visual layout? I feel like you're not comparing apples to apples. What's so readable and obvious about tables nested 3-4 levels deep?

Anyone who really thinks about how CSS can be used is also going to be against div-itis but it's still less-bad than tables for layout. They're also going to be against excessive use of classes and class names that connote style (class="red") rather than purpose (class="alert").

Re: CSS Grid – Table layout is back. Be there and be square

#137

I don't know how to say it politely but what has been achieved by using ad-hoc syntax such as this gem (and similar complex CSS syntax): display: grid; grid-template-rows: 150px [nav-start] auto 100px [nav-end]; grid-template-columns: [header-start] minmax(200px, 3fr) 9fr [header-end]; CSS fans for some reason seem to think that its somehow better to have rendering/presentational properties in an ad-hoc language. Ori…

I'm glad someone else said it. I particularly like that they've introduced a new unit, `fr`, and can't even decide what it stands for. I've been writing CSS since about 1996; for some reason, I feel like it all started to go downhill, fast, with the background gradient syntax.

> I feel like it all started to go downhill, fast, with the background gradient syntax

I'll take background in CSS over tiled 1px-wide gradient background images any day. The responsibilities being piled to CSS keep increasing, but I believe it is being done in good faith to at improve/formalize what people in the wild are already doing with hacks. Remember DHTML?

Re: CSS Grid – Table layout is back. Be there and be square

#138

Earlier quoted context omitted.

The (theoretical) issue here is that a "table" has a certain semantic meaning ("a container for tabular data"), and that using a table for something outside that semantic meaning can introduce confusion, be it for fellow programmers (including your future self!) or for those who are interpreting your page in weird ways (robots, people using screen readers, etc.). In the few times I actually bother with frontend "desi…

I have 30,000 unique visitors to my website every day. The number who care whether HTML tags are being outside their semantic purity is zero.

A. How would you know what they care about?

B. Maybe if you cared, you'd have 30,300 unique visitors, or more. I don't know, I don't know how bad your site's code is.

Re: CSS Grid – Table layout is back. Be there and be square

#139
post #129

Earlier quoted context omitted.

Nothing. But tables are for tabular data. Laying out a page using a table to divide it up and make it look pretty (or in lots of cases, lay it out so it performs some kind of sales based task) doesn't make much sense. Hence the preferred CSS route, even if the markup is just as verbose (as mentioned in this thread). Web apps aside [sigh], if one was to disable CSS (and thus all the blocks making it look pretty), the…

But why is that beneficial?

I'm on a crap connection, and it's not unusual for the styling content to not make it (whether it's CSS or javascript). The ones that follow these principles remain usable, the ones that don't, don't.

Re: CSS Grid – Table layout is back. Be there and be square

#140
post #39

Makes you wonder why HN won't budge with those tags in the source code. One day I hope to see "Table layouts are back with tags" and the HN programmers would have saved themselves so much work.

What, exactly, is the problem with the tag in the first place? Been a long, long time since I last touched HTML

The problem is that other web designers will laugh at you and kick sand in your face. Possibly in front of your clients.
Post reply on HN