Live data from Hacker News

Ask YC: Why is YC's layout table based?

news.ycombinator.com

41–50 of 93 posts

Re: Ask YC: Why is YC's layout table based?

#41
post #39

Earlier quoted context omitted.

>Why, to center an object, do I have to remember trivia like "the parent needs a width." Because you're still viewing the page as a table. Once you stop doing this, you stop asking questions like these.

I'm open to new perspectives. In what way I should I see the page such that "center me in my parent" is unreasonable unless the parent has a fixed width? What, in particular, about the box model makes this impossible?

The notion of "center" doesn't exist without a width.

Now, you could give the object in question a width and simply give it margin-left/right: auto. That would center it in the width-less parent, but it wouldn't fix its position to the particular spot you're currently seeing it in.

For understanding, take it up to the highest level, the browser window. Make your browser 1024x768. Now make it bigger or larger - where is the "center"? It's moved depending on the size of the browser window.

If you have a parent whose width is variable, you can't center the child. The key is that, unlike years of using tables to hack up a website, the canvas CSS uses is variable; its height and width is undefined. Thinking of it like this, it makes perfect sense that center isn't used.

Re: Ask YC: Why is YC's layout table based?

#43
post #36
post #26

Earlier quoted context omitted.

CSS has a learning curve yes, so it always going to seem harder than it should be in the beginning, but otherwise it shouldn't make a difference time-wise to create a table or css based layout.

... Until you realize that your fancy CSS doesn't display properly in IE6.

Which, on a site like this, can be safely ignored! :)

Re: Ask YC: Why is YC's layout table based?

#44
post #36

Earlier quoted context omitted.

... Until you realize that your fancy CSS doesn't display properly in IE6.

Which, on a site like this, can be safely ignored! :)

So you admit that fancy CSS for mainstream sites is generally a huge time sink?

Re: Ask YC: Why is YC's layout table based?

#45
post #39

Earlier quoted context omitted.

I'm open to new perspectives. In what way I should I see the page such that "center me in my parent" is unreasonable unless the parent has a fixed width? What, in particular, about the box model makes this impossible?

The notion of "center" doesn't exist without a width. Now, you could give the object in question a width and simply give it margin-left/right: auto. That would center it in the width-less parent, but it wouldn't fix its position to the particular spot you're currently seeing it in. For understanding, take it up to the highest level, the browser window. Make your browser 1024x768. Now make it bigger or larger - where…

I don't follow. At any instant in time, every element on a webpage has a well-formed width. So why can't a child be centered, using that width?

Re: Ask YC: Why is YC's layout table based?

#46
post #44

Earlier quoted context omitted.

Which, on a site like this, can be safely ignored! :)

So you admit that fancy CSS for mainstream sites is generally a huge time sink?

No, spending time correcting bugs of a browser that 3% of a particular site's users actually use is a waste of time.

Correcting IE6 bugs on a mainstream site is part of the job. (and not that bad once you get the hang of it unless you've got a heavy design)

I'd be very surprised if a CSS version of Hacker news needed any IE hacks at all really.

Re: Ask YC: Why is YC's layout table based?

#47
post #35

Because the data is tabular?

Um, Tabular data of a single column is usually referred to as a list. :-) Seriously though, it's not just a list, it's an ordered list.

It's not just an ordered list! It's also a database!

But seriously, you can play that game forever. At some point, you have to pick one definition and stick with it. This site uses tables.

Re: Ask YC: Why is YC's layout table based?

#48
post #23
post #11

Earlier quoted context omitted.

Who gives a shit? Hackers. And, y'know, with this happening to be Hacker News and all, it works.

You can't "hack" html or css, they aren't languages. Furthermore, CSS is a lie. A lie for designer snobs.

It's been pointed out that HTML is not Turing complete. You can interpret a page as a state and a link as a transition. That makes HTML the equivalent of regular expressions. Definitely worthy of the title hack.

Re: Ask YC: Why is YC's layout table based?

#49
post #45

Earlier quoted context omitted.

The notion of "center" doesn't exist without a width. Now, you could give the object in question a width and simply give it margin-left/right: auto. That would center it in the width-less parent, but it wouldn't fix its position to the particular spot you're currently seeing it in. For understanding, take it up to the highest level, the browser window. Make your browser 1024x768. Now make it bigger or larger - where…

I don't follow. At any instant in time, every element on a webpage has a well-formed width. So why can't a child be centered, using that width?

>At any instant in time, every element on a webpage has a well-formed width.

That's not exactly true. Every block element has a width, but inline objects do not. Furthermore, some block elements may have fixed widths, while others may be designed to take up as little as they require.

The "center" attribute that you describe would run counter to the visual formatting model of the standard that is in place to support a number of other things. That would mean that its behaviour would be next to impossible to design around if you were trying to account for all of your users screen sizes at the same time.

See here: http://www.w3.org/TR/REC-CSS2/visuren.html#containing-block

Re: Ask YC: Why is YC's layout table based?

#50
post #47

Earlier quoted context omitted.

Um, Tabular data of a single column is usually referred to as a list. :-) Seriously though, it's not just a list, it's an ordered list.

It's not just an ordered list! It's also a database! But seriously, you can play that game forever. At some point, you have to pick one definition and stick with it. This site uses tables.

That's just it though, it doesn't. It simply uses tables to display the list, when it doesn't have to.

Not worth arguing over in all but the lowest levels though.

Post reply on HN