Programming Journal C#, Java, SQL and to a lesser extent HTML, CSS, XML, and regex. I made this so other programmers could benefit from my experience.

Friday, September 14, 2007

HTML Table header accessibility standards

This fascinating piece of law regarding federal accessibility standards on HTML table headers requires data tables that contain two more rows or columns to identify row and column headers. The header fields that you create render as , and the columns reference the headers. . The bottom line: Use TH for table headers.

ILLEGAL:


<TABLE>
<TR><TD>Stock</TD><TD>Price</TD></TR>
<TR><TD>AAPL</TD><TD>133.33</TD></TR>
</TABLE>


LEGAL


<TABLE>
<TR><TH SCOPE="COL">Stock</TH> <TH SCOPE="COL">Price</TH></TR>
<TR><TD>AAPL</TD> <TD>133.33</TD></TR>
</TABLE>


Microsoft Article: from excerpt
To better understand the DataGrid's rendering machinery, it's useful to review how the DataGrid's implementation has changed after the hotfix discussed in Knowledge Base article 823030 ("FIX: DataGrid Made Compliant with Section 508 of the Rehabilitation Act Amendments of 1998"). In ASP.NET 1.1, the DataGrid's markup is not compliant with Section 508 of the Rehabilitation Act Amendments of 1998, a U.S. law regarding accessibility standards. To resolve this problem, Microsoft made a hotfix rollup package available, as explained in the aforementioned article. In short, the act states that data tables that contain two or more rows or columns must clearly identify row and column headers. This means that, at the very minimum, the header row(s) of an HTML table must define its cells through the TH tag instead of the ordinary TD tag.

No comments: