I've got a theme function in a module that I'm working on. It's for a configuration page with several different sets of controls that are grouped into fieldsets. One group of items consists of tabular data. I'd like this group to be placed in a fieldset, but I can't find a way to do so. There doesn't seem to be a way to specify how a table should be placed in a fieldset.
Are there any examples of how to do this? Has anyone run into this problem and figured it out? It was mentioned here, but there was never any resolution.
Right now I've got this bit of code for the form:
// Create the Link Types section.
$form['relatedlinks_types'] = array(
'#tree' => TRUE,
'#weight' => 3,
);
And this for the rendering:
// Render the link type data in a table sorted by weight.
foreach (array_keys($weights) as $type) {
$rows[] = array(
form_render($form['relatedlinks_types'][$type]['name']),
form_render($form['relatedlinks_types'][$type]['enabled']),
form_render($form['relatedlinks_types'][$type]['weight']),
form_render($form['relatedlinks_types'][$type]['title']),
form_render($form['relatedlinks_types'][$type]['max']),
);
}
$header = array(t('Link Type'), t('Enabled'), t('Weight'), t('Title'), t('Limit'));
$output = theme('table', $header, $rows, array('style' => 'width: 100%'));