Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I also like how CSS has less layout functionality than tables, specifically <td width="*" valign="middle">.

Sure, you can emulate this with "display: table;" but a) it's not backwards compatible and b) that's the same darn thing as just using a table!



It's not "the same darn thing". The <table> tag is for tabular data, it implies relationships between it's elements that are of utter importance for screen readers and machines. It might be ok visually, but structurally it's a mess.

display:table is not an emulation, it's exactly the same behavior as a table, exposed for use at will. You can use the flexbox model for the same effect: http://jsbin.com/ejeraq

Be very glad that you have good vision and Google engineers spend millions and decades on making some sense of tag soup.


Your passion is commendable. I'll not go into the "a <li> is more semantic and accessible than a <td>" debate.

I'll just say that 1) display:table-cell doesn't work in IE6/7 and 2) CSS's limitations make it annoying or impossible to achieve functionality that was easy with table layouts (eg mixing percentage widths with fixed widths, and vertical aligment).


That you fail to mention, that table layouts make a lot more things annoying or impossible to achieve.


> The <table> tag is for tabular data, it implies relationships between it's elements that are of utter importance for screen readers and machines.

Nope. The <table> element was originally defined as an all-purpose chainsaw for two-dimensional relationships. The browser crackmonkeys locked us into that in the late '90s, and we have to deal with it forever. We are stuck with the legacy of billions of old documents, and thousands of old HTML parsers.

The W3C is pissing into the wind by trying to rewrite history. They cannot simply wish away technical lock-in by putting a "TABLE elements are semantic" clause in a standard. That needs to be repealed, and the we-must-ignore-history children must be given a spanking and sent to their rooms.

What the W3C should do is define a "tabulartext" attribute:

    <!-- A table of data to read -->
    <table tabulartext>
        <tr><th>Title</th> <th>Title</th></tr>
        <tr><td>Data</td> <td>Data</td></tr>
    </table>

    <!-- Structural markup -->
    <table>
      <tr>
        <td>{{left_sidebar}}</td>
        <td>{{content}}</td>
        <td>{{right_sidebar}}</td>
      </tr>
    </table>
If they did this, the screen readers and Alexa top 500 sites would STAMPEDE towards a bright new future of accessibility, machine readability, and backwards compatibility.


You're joking right?

The HTML table model allows authors to arrange data -- text, preformatted text, images, links, forms, form fields, other tables, etc. -- into rows and columns of cells. - HTML 4.01 specification, 1999

Tables were added in the HTML3 spec:

HTML 3.2 includes a widely deployed subset of the specification given in RFC 1942 and can be used to markup tabular material or for layout purposes. Note that the latter role typically causes problems when rending to speech or to text only user agents. - HTML3.2, 1997

The "for layout purposes" was a big mistake, they even acknowledged that it wasn't adequate. Fixed 2 years later, or 10 years ago. There is no reason to markup things as tables when you can have a much clearer document outline using the proper header and grouping elements.

HTML5 parsers have no problem keeping up with old tag soup, but that doesn't mean we should keep writing crap. Implying that sites built using only tables are accessible and machine readable is just.. asinine.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: