How to display form module in two coloms? I again looking for your help.
I have a form module that should be displayed in two coloms, like this one:
http://www.quickbase.com/help/images/form_example.gif
I did a lot of researches for how to solve this and couldn't find so much.

do I need both functions hook_form_alter and hook_theme?

should they look like this?
function my_module_form_alter(&amp;$form, &amp;$form_data, $form_id){ if(stripos($form, 'my_module_form') === 0 &amp;&amp; $form['#parameters'][2]-&gt;type =='product') {
        $form_data['#theme']  = 'mytemplate';
         }
}

function my_module_theme() 
    {
          return array(
            'my_module_form' =&gt; array(
              'arguments' =&gt; array('form' =&gt; NULL),
              'template' =&gt; 'mytemplate',
            ),
          );
        }


What should contain file mytemplate.tpl.php ?



Here is part of my form:
function my_module_form($form_data) {
    $form['contact_information'] = array(
        '#value' =&gt; variable_get('contact_form_information', t('Please fill in all fields.'))
    );
    $form['first'] = array(
        '#type' =&gt; 'textfield',
        '#title' =&gt; t('First name'),
        '#maxlength' =&gt; 20,
        '#required' =&gt; TRUE,
    );
    $form['last'] = array(
        '#type' =&gt; 'textfield',
        '#title' =&gt; t('Last name'),
        '#maxlength' =&gt; 20,
        '#required' =&gt; TRUE,
    );
    $form['street'] = array(
        '#type' =&gt; 'textfield',
        '#title' =&gt; t('Street Address'),
        '#required' =&gt; TRUE,
    );
ect

Finally I solved it:
function my_module_theme($existing, $type, $theme, $path) {
  $hooks['my_module_form'] = array(
    'template' =&gt; 'mytemplate',
    'arguments' =&gt; array('form' =&gt; NULL),
  );
  return $hooks;
}

and here is mytemplate.tpl.php
&lt;div style=&quot;float:right; width: 100%; height:20px; text-align:left;&quot;&gt; 
        &lt;?php print_r(drupal_render($form['contact_information'])); ?&gt;
    &lt;/div&gt;
&lt;div style=&quot;margin-top: -1em;&quot;&gt;
    &lt;div style=&quot;float:left;&quot;&gt; 
        &lt;strong&gt;&lt;?php print_r(drupal_render($form['first'])); ?&gt;&lt;/strong&gt;
    &lt;/div&gt;
    &lt;div style=&quot;float:right;&quot;&gt; 
        &lt;strong&gt;&lt;?php print_r(drupal_render($form['last'])); ?&gt;&lt;/strong&gt;
    &lt;/div&gt;
    &lt;div style=&quot;float:left;&quot;&gt; 
        &lt;strong&gt;&lt;?php print_r(drupal_render($form['street'])); ?&gt;&lt;/strong&gt;
    &lt;/div&gt;
    &lt;div style=&quot;float:right;&quot;&gt; 
        &lt;strong&gt;&lt;?php print_r(drupal_render($form['city'])); ?&gt;&lt;/strong&gt;
    &lt;/div&gt;
    &lt;div style=&quot;float: left;&quot;&gt;  
        &lt;strong&gt;&lt;?php print_r(drupal_render($form['postal'])); ?&gt;&lt;/strong&gt;
    &lt;/div&gt;
    &lt;div style=&quot;float:right; width:385px;&quot;&gt;     
        &lt;strong&gt;&lt;?php print_r(drupal_render($form['state'])); ?&gt;&lt;/strong&gt;
    &lt;/div&gt;
    &lt;div style=&quot;float:right;&quot;&gt;
        &lt;strong&gt;&lt;?php print_r(drupal_render($form['mobile'])); ?&gt;&lt;/strong&gt;
    &lt;/div&gt;
    &lt;div style=&quot;float:right; &quot;&gt;
        &lt;strong&gt;&lt;?php print_r(drupal_render($form['ext'])); ?&gt;&lt;/strong&gt;
    &lt;/div&gt;
    &lt;div style=&quot;float:right;&quot;&gt;
        &lt;strong&gt;&lt;?php print_r(drupal_render($form['phone'])); ?&gt;&lt;/strong&gt;
    &lt;/div&gt;
    &lt;div style=&quot;float:left;&quot;&gt;
        &lt;strong&gt;&lt;?php print_r(drupal_render($form['home_phone'])); ?&gt;&lt;/strong&gt;
    &lt;/div&gt;
    &lt;div style=&quot;float:right;&quot;&gt;
        &lt;strong&gt;&lt;?php print_r(drupal_render($form['email'])); ?&gt;&lt;/strong&gt;
    &lt;/div&gt;  
&lt;/div&gt;

    &lt;div style=&quot;background-color:#EEEEEE;
        float:left; 
        margin-bottom: -5%;
        width: 100%;
        text-align:right;&quot;&gt; 
                &lt;?php echo drupal_render($form['submit']),
                            drupal_render($form['clear']); ?&gt;
&lt;/div&gt;
You can use the markup-type in your form array to group form items and then style the groups.
The code below will wrap the three items with a div which has the class column-left. Do the same for the right column.

To clear things up: The column_left-item is of the type markup, which is the default type.

$form['column_left'] = array(
    '#prefix' =&gt; '&lt;div class="column-left"&gt;', 
    '#suffix' =&gt; '&lt;/div&gt;',
);
$form['column_left']['first'] = array(
    '#type' =&gt; 'textfield',
    '#title' =&gt; t('First name'),
    '#maxlength' =&gt; 20,
    '#required' =&gt; TRUE,
);
$form['column_left']['last'] = array(
    '#type' =&gt; 'textfield',
    '#title' =&gt; t('Last name'),
    '#maxlength' =&gt; 20,
    '#required' =&gt; TRUE,
);
$form['column_left']['street'] = array(
    '#type' =&gt; 'textfield',
    '#title' =&gt; t('Street Address'),
    '#required' =&gt; TRUE,
);


For Drupal 7, you can use the container-type and use the attributes array to add the class. A div is generated automatically.

$form['column_left'] = array(
  '#type' =&gt; 'container',
  '#attributes' =&gt; array(
    'class' =&gt; array('column-left'),
  ),
);