I have a pretty ordinary tableselect element that looks like so

$form['registration_table'] = array(
    '#type' => 'tableselect',
    '#header' => $header,
    '#options' => $enrollment_options,
    '#js_select' => FALSE,
    '#multiple' => TRUE,

What I would like is to be able to use the empty space which is reserved for the "select all" checkbox for a text label. I would like to indicate by the label what action the checkboxes represent. In this case they represent selecting a course to register for so I would like to add the label "Register" there. Any advice on how to do this?


For doing this you have to change the "theme_tableselect" core code. See this documentation code part. If you do not set "select all" then the header is assigned to null

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.