The 'tableselect' form element type ostensibly accepts an #attributes property (like almost every other element type).

However, when generating the table in theme_tableselect, this property is not passed on:

  return theme('table', array('header' => $header, 'rows' => $rows, 'empty' => $element['#empty']);

In order to add the attributes onto the table, this line would have to be:

  return theme('table', array('header' => $header, 'rows' => $rows, 'empty' => $element['#empty'], 'attributes' => $element['#attributes']));

(Fixing this will incidentally make it possible to combine tabledrag and tableselect on the same table, which is pretty awesome.)

Comments

cburschka’s picture

Status: Active » Needs review
StatusFileSize
new768 bytes

Here is my patch:

moshe weitzman’s picture

Status: Needs review » Reviewed & tested by the community
webchick’s picture

Status: Reviewed & tested by the community » Fixed

Committed to HEAD. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.