top | item 13529076

(no title)

supersan | 9 years ago

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

discuss

order

orbat|9 years ago

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

leppr|9 years ago

It's neither flexible nor semantic.

Flexibility is what allowed webpages to be "responsive" before media-queries even existed, and semantics is what allows accessibility, search engines, and other html parsing tools ("readability" in Firefox and Safari, ...) to function better.

The only advantage it has is that it's old and predictable. That's why it's still used to format emails for instance, it's reliable and works on most supports.

mattmanser|9 years ago

        <table>
          <tr>
            <td>
              <table>
                <tr>
                  <td>
                    <table>
                       <tr>
                         <td>
That's the problem.

This argument was over a decade ago and it's because it's a nightmare to work in tag soup.

I still have to deal with tables for layout on mail templates, bloody Outlook, and that extra 2 layers of tag nesting you have to do on every level quickly turns the code into an incomprehensible mess, even with careful indentation.

And if you're not very careful with indentation it turns into an utter nightmare.

DavidSJ|9 years ago

There's no problem. But sometime around 2003 it became trendy to do all layout in CSS, even when a table or a <center> tag would do just fine.

iamben|9 years ago

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 page should still make sense. An H1 as the main header, copy in paragraphs, headers dividing up the content, blockquotes, navigation in lists - and tabular data in tables (etc, etc).

It doesn't always work like that in practice, but that's the aim.

keypress|9 years ago

One was that you once had to wait for the deepest nested table to render before the rest. And there used to be tables in tables in tables.

Joeboy|9 years ago

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

keypress|9 years ago

Little irritations like: A form is not allowed to be a child element of a table, tbody or tr. There are workarounds.

Pyxl101|9 years ago

Would there be a benefit to changing from <table> to something else, if <table> works just fine for the purpose?

If it ain't broke, right?

robin_reala|9 years ago

It is broken. Every single comment is announced (in Voiceover at least) with “Row x of y. Column 1 of 1”. With proper markup you could either avoid that entirely, or announce a correct relationship with ARIA attributes.

projectileboy|9 years ago

Does this affect your experience as a user?