The theme named form_panel_table provides a table-based output. The theme named form_panel_div wraps each row in a <div> tag with a specific class, and each element in its own <div>.

You can choose which theme to use by assigning it to the #theme attribute of the form element enclosing those you wish to theme. For instance:

  $form = array('#theme' => 'form_panel_table');
  $form['foo'] = ...first form element goes here...
  $form['bar'] = ...second form element goes here...

If you are adding a table or <div> set to an existing form, it can help to put this into a sub-array:

  $form['my-table'] = array('#theme' => 'form_panel_table');
  $form['my-table']['foo'] = ...first form element goes here...
  $form['my-table']['bar'] = ...second form element goes here...

Comments

matt.robinson1’s picture

Sorry, but I think I'm missing something basic.

Where do you add/edit this code?

coolhandlukek2’s picture

Hi.

A non drupal ninja would love to use this but cant work it out... :-(

Is there a screencast or A to Z tutorial out there?

Thx