ChangeProposals/layouttables

From HTML WG Wiki
< ChangeProposals
Revision as of 15:24, 21 December 2010 by Rschwer (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


Allow tables to be used for presentational purposes

Summary

Soften the text on the use of tables used for presentation in the HTML 5 specification

Rationale

Tables are used for presentation extensively throughout the web. For example, it is used in GMail and hundreds of IBM products. This is unlikely to change. Stating that a table must not be used for layout is impractical as is requiring a user agent or an assistive technology to create their own set of heuristics for determining if a table is to be used for layout. The WAI has developed an ARIA role that is now supported in IE, Firefox (Windows and Linux), and Safari called "presentation". It is also used extensively on the web in libraries like Dojo, hundreds of Web 2.0 applications and key assistive technologies like the JAWS screen reader. When applied to a table it provides a declarative way of stating that the table is being used for layout and actually removes the confusing table semantics from the platform accessibility API producing a reliable accessible solution and improving assistive technology processing performance. This approach is much easier to implement by authors who have made sizeable investments in the use of tables. It is a much lighter weight change than having to convert numerous applications, like databases to use a CSS Table approach when generating web content.

Details

In the section of the HTML 5 specification entitled The table element (based on the November 16, 2010 draft of the HTML 5 specification):

<change>

Tables must not be used as layout aids. Historically, some Web authors have misused tables in HTML as a way to control their page layout. This usage is non-conforming, because tools attempting to extract tabular data from such documents would obtain very confusing results. In particular, users of accessibility tools like screen readers are likely to find it very difficult to navigate pages with tables used for layout.

There are a variety of alternatives to using HTML tables for layout, primarily using CSS positioning and the CSS table model.

User agents that do table analysis on arbitrary content are encouraged to find heuristics to determine which tables actually contain data and which are merely being used for layout. This specification does not define a precise heuristic.

</change>

<to>

Tables should not be used as layout aids. Historically, many Web authors have tables in HTML as a way to control their page layout making it difficult to extract tabular data from such documents. In particular, users of accessibility tools, like screen readers, are likely to find it very difficult to navigate pages with tables used for layout. If a table is to be used for layout it must be marked with the attribute role="presentation" for a user agent to properly represent the table to an assistive technology and to properly convey the intent of the author to tools that wish to extract tabular data from the document.

There are a variety of alternatives to using HTML tables for layout, primarily using CSS positioning and the CSS table model.

</to>

Impact

The impact to the specification is minor and it minimizes the impact to authors while producing a more reliably accessible solution.

Positive Effects

  • The change places the specification in line with how the Web is used today yet it does not discourage the use of CSS to lay out tables.
  • The requirement to not use tables for layout was largely ignored in HTML 4. Through the addition of role="presentation" it provides a declarative way for the author to identify a layout table without an enormous impact on web authors while at the same time directing authors to use alternative solutions like a CSS Table model.
  • It is conforming to have role="presentation" on a table element in HTML 5

Negative Effects

none.

Risks

None.

References

WAI-ARIA presentation role