[support] HowTo: table within a fieldset

Stefan Borchert stefan at borchert.cc
Wed Oct 25 21:01:05 UTC 2006


Hi.
After posting by accident to the themes-list, I try it here:

For a module settings page I would like to build up a table of 
available extensions (don't care about, just think of a simple table) 
but this table should be within a fieldset (collapsible).
[code]
    $form['ext'] = array('#type' => 'fieldset',
        '#collapsible' => true,
        '#collapsed' => true,
        '#tree' => true,
        '#title' => t('Extensions'));

    // build extension table
  foreach ($extensions as $key => $extension) {
    $form['ext'][$key]['status'] = array('#type' => 'checkbox', 
'#default_value' => $extension['status']);
    $form['ext'][$key]['weight'] = array('#type' => 'weight', 
'#default_value' => $extension['weight']);
    $form['ext'][$key]['title'] = array('#value' => $extension['title']);
  }
[/code]
Other form elements above and below of this fieldset (for 
example the submit button) are displayed correctly but I can't put the table into the fieldset.
How do I handle this?
I can build the table and can build the fieldset but the table doesn't 
want to appear within the fieldset.

Any ideas (or a handbook page) or is this simply impossible?


Stefan



More information about the support mailing list