News for hackers. Stuff that matters.
Re:Ask HN: Why does this site use center and table tags? by codeka on Saturday August 11, 2012 @11:15AM (#4370238)
The main problem for me is it makes the site pretty painful to use on a mobile browser. With proper markup and good CSS, the site could easily be much more usable on a smaller screen.
Re:Ask HN: Why does this site use center and table tags? by ColinWright on Saturday August 11, 2012 @11:23AM (#4370252)
Interesting. It works fine for me on my mobile device, and on my netbook, whereas other modern mobile sites often don't.
Re:Ask HN: Why does this site use center and table tags? by codeka on Saturday August 11, 2012 @11:37AM (#4370279)
It "works", but not without copious zooming and scrolling. Clicking the vote buttons in particular is a kind of challenge I don't like subjecting myself to and I actually find I vote on comments much less frequently on my phone than on my desktop browser just because its such a pain.

I know what you mean about many mobile sites since people often assume the only mobile devices are iPhones and Androids and nothing else, but that doesn't mean the way this site works is any better :)

Re:Ask HN: Why does this site use center and table tags? by grey-area on Saturday August 11, 2012 @12:49PM (#4370444)
I agree about the voting buttons and mobile use in general on this site (many links are small and hard to hit) but to be fair that has nothing to do with the use of table tags and center.
Re:Ask HN: Why does this site use center and table tags? by jmduke on Saturday August 11, 2012 @11:27AM (#4370263)
What mobile device do you have? It's impossible to read on my iPhone.
Re:Ask HN: Why does this site use center and table tags? by __chrismc on Saturday August 11, 2012 @12:02PM (#4370333)
I wouldn't say it's impossible to read on my 4S, but it is certainly not "optimal", due to the table-based layout (with large margins). The page is zoomed out quite far when first loaded. Text is rendered pretty small, even when you double-tap to zoom in on the content "column". It's readable for me, but I still have pretty reasonable eye-sight. I can imagine it would be a lot harder if your eyes were even just slightly less capable than mine.

As for the original question "why?" - my guess is because a) it works, and b) it's quick. Sometimes you need to be pragmatic about these things.

Re:Ask HN: Why does this site use center and table tags? by Phlarp on Monday August 13, 2012 @01:07PM (#4376873)
Do people really read the desktop version on mobile? The hn.gethifi mobile site is excellent!
Re:Ask HN: Why does this site use center and table tags? by ColinWright on Saturday August 11, 2012 @11:28AM (#4370265)
Renders perfectly well on my Blackberry (foist upon me by work)
Re:Ask HN: Why does this site use center and table tags? by gbog on Saturday August 11, 2012 @11:24AM (#4370254)
Same here. I'd add that trying to get better content is not completely decorrelated from improving the interface. In fact, it could have a negative correlation: only those who really have something to say would use ugly and unfriendly interface...
Re:Ask HN: Why does this site use center and table tags? by vampirechicken on Monday August 13, 2012 @11:35AM (#4376349)
Google said they would rank sites that use tables for structure lower than they would rank site that used semantic HTML and CSS.

However, CSS has, in the past, been extremely annoying to use if you want a simple tabular layout to your web site.

As other's have, or will point out, the table tags can end up being more data that you'll download each time the page contents are sent, whereas css, if you do it correctly - in a file external to the HTML - will only be downloaded one time, saving bandwidth and time.

If the site's author doesn't care about the SEO demerits of using a table, then she's not going to spend the time converting the site. This has the side effect of annoying semantic HTML purists, who believe that the HTML should only describe the content and only CSS should be used to apply styling.

While the semantic+CSS camp has a fair point, I will admit to being driven near raving mad trying to make CSS do things that were dead simple using a table. So I empathize with the people who don't want to spend large amounts of time figuring out how to make CSS do what they mean.

Re:Ask HN: Why does this site use center and table tags? by hartleybrody on Monday August 13, 2012 @01:27PM (#4376967)
> I will admit to being driven near raving mad trying to make CSS do things that were dead simple using a table.

Definitely true. I'm usually in the semantic+CSS camp, but for lots of simple projects (which I'd say HN is) those considerations can really bog you down. Use tables -- knowing they're suboptimal in certain situations -- and get on with it.

Re:Ask HN: Why does this site use center and table tags? by Johngibb on Thursday August 23, 2012 @11:43PM (#4426078)
When data is tabular, tables make sense. I think there's been a lot of brainwashing that tables are evil; really, it's just that tables aren't ideal for layout.

If you've got a page with tabular data, use the table tag! It's semantically valid and a concise way to get the proper formatting!

But, if you're trying to lay things out - it's likely a grid layout will do the job better. Straight CSS is pretty hard to get right with all the floats, but starting with a grid system and especially something even higher level like Twitter Bootstrap can really be productive. Note, however, that bootstrap still supports and encourages tables when it makes sense.

Re:Ask HN: Why does this site use center and table tags? by vampirechicken on Friday August 24, 2012 @11:24AM (#4427989)
I agree. My point was that pre-css-grid, it was easier to use a table to build a pages's layout than it was to figure out the wibbly-wobbly divvy-floaty stuff.