There are several ways to display parts of a node in multiple columns, but the only one I could find that works with form input fields involved a template file. This is tedious, and difficult to maintain when adding new fields to the form.
So I'm working on a module which provides two theme functions which, in turn, provide an easy way to put multiple input form elements on the same line. At the most basic level, it can turn this:
First Name:
[text]
Last Name:
[text]into this:
First Name: Last Name:
[text] [text]It can do this using either an HTML table or DIV tags. In both cases, it includes various CSS classes to help with styling.
It works by either looking for two special row/column attributes, or by parsing the #weight field, of a set of Forms API inputs. It can even handle the case where output is to be put into a table, and some of the cells span adjacent rows or columns.
This basic example generates a table with the letters "A" through "D" in two rows of two cells each. (Normally, you would replace the "#value" with "#type", and add other Forms API attributes.)
$form = array(
'#theme' => 'form_panel_table',
'#form_panel_table_attributes' => array('border' => 1));
$i = ord('A');
$form[] = array('#value' => chr($i++), '#weight' => 2001);
$form[] = array('#value' => chr($i++), '#weight' => 2002);
$form[] = array('#value' => chr($i++), '#weight' => 3001);
$form[] = array('#value' => chr($i++), '#weight' => 3002);
print drupal_render($form);
---------
| A | B |
---------
| C | D |
---------To have "C" span both columns of the table, it's a simple matter of omitting the last $form[] line, which produces:
---------
| A | B |
---------
| C |
---------In the future, I hope to extend module this to allow CCK's "Manage Fields" table to be modified, so that it can set both the row and the column--possibly even using a modified version of the drag & drop jQuery code.