For extra accessibility and semanticity we should throw in a thead tag if there is a header row and always put in a tbody tag.

CommentFileSizeAuthor
#7 theme.inc_3.diff1.38 KBdrumm
theme.inc_2.diff1.26 KBdrumm
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Zach Harkey’s picture

+1 on the direction. But we also need to add TFOOT.

All themed tables should have the ability to add THEAD,TFOOT, and TBODY to support true semantic table building.

Dries’s picture

Status: Needs review » Fixed

Committed to HEAD. Thanks.

Maybe look into http://drupal.org/node/28777 next?

Dries’s picture

Status: Fixed » Needs review

Never mind my previous comment. Attached it to the wrong issue.

Crell’s picture

I would actually say NO to tfoot, on the grounds that the HTML spec is broken with regards to tfoot. It doesn't degrade gracefully. An unrecognized thead has essentially no effect. An unrecognized tfoot means that the footer row gets rendered above the tbody, but if recognized then it appears after the tbody. I don't know what W3C moron came up with that idea, but that's the reason why I never use tfoot. :-)

Besides, there's no current use of what would go into a footer in Drupal, as far as I know. We do, however, already have a $header parameter, so wrapping that in thead makes sense. The patch will need to be updated, though, since http://drupal.org/node/30423 updates this function as well.

I am curious why the switch from $attributes = NULL to $attribures = array(), though. What's the reasoning for that? (I'm not opposed necessarily, just curious.)

drumm’s picture

The attributes argument takes an array so it makes sense to make the default value an empty array rather than NULL.

Dries’s picture

Status: Needs review » Needs work

Patch no longer applies.

drumm’s picture

Status: Needs work » Needs review
FileSize
1.38 KB

Updated patch.

Crell’s picture

Status: Needs review » Reviewed & tested by the community

Is this still open?

Patch applies cleanly to HEAD, doesn't break anything, and obeys coding conventions. Let's get this one committed.

Dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to HEAD.

drumm’s picture

Status: Fixed » Closed (fixed)