Monday, 12 May 2008

TableHeaderScope enum does not generate XHTML-compliant output

When adding the scope attribute to a column for accessibility, the following does not generate XHTML-compliant output:

TableHeaderCell th = new TableHeaderCell();
th.Scope = TableHeaderScope.Column;

It generates the following HTML:
<th scope="column">

The value of the scope attribute should be "col". A work-around is to add the scope attribute manually using the Attributes collection:

th.Attributes.Add("scope", "col");

1 comment:

Ciz said...

I've done some more digging into this...
http://chrisfulstow.com/blog/post/TableHeaderScopeColumn-and-HTML-standards-compliance.aspx