Webform table element and Webform I am trying to create a form with essentially form elements stored inside a table. After digging around,  have two alternatives:

1) Install Webform module along with the Webform Table Element module. Now both modules have been enabled and have cleared the caches for the heck of it. I can make the Webform alright, but I don't know how to make use of the Webform table element module and make the webform contents appear within a table. So I am not sure how to go about doing this

2) (SIDE QUESTION):  The other alternative is to create a custom module that would let me build my own form with tables and all that jazz. But I am keen on learning the Drupal way although I always prefer hand-coding my challenges.
Drupal has theme() which can be used to create a table in a form. Your theme function must be registered with hook_theme().

function MODULE_NAME_theme() {
  return array(
   'MODULE_NAME_header_menu' =&gt; array(
     'arguments' =&gt; array(
       'form' =&gt; NULL,
      ),
   ),
}

function theme_MODULE_NAME_header_menu($form) {
  $rows = array();
  foreach (element_children($form) as $key) {
    if (is_numeric($key)) {
      $wt = $form[$key]['weight' . $key]['#value'];
      $menu_title = drupal_render($form[$key]['title' . $key]);
      $row[] = array('data' =&gt; $menu_title);
      $href = drupal_render($form[$key]['href' . $key]);
      $row[] = array('data' =&gt; $href);
      $weight = drupal_render($form[$key]['weight' . $key]);
      $row[] = array('data' =&gt; $weight);
      $remove = drupal_render($form[$key]['remove' . $key]);
      $row[] = array('data' =&gt; $remove);
      $rows[$wt] = array('data' =&gt; $row);
      unset($row);
    }
  }
  // Individual table headers.
  $header = array();
  $header[] = array('data' =&gt; t('Title'), 'class' =&gt; 'menu-title');
  $header[] = array('data' =&gt; t('URL'), 'class' =&gt; 'menu-href');
  $header[] = array('data' =&gt; t('Weight'), 'class' =&gt; 'menu-weight');
  $header[] = array('data' =&gt; t('Remove'), 'class' =&gt; 'menu-remove');

  $output = theme('table', $header, $rows, array('id' =&gt; 'header-menu-table'));  
  $output .=  drupal_render($form);

  return $output;
}


This creates a table with three columns (if the form has three numeric array keys: "title", "href", and "weight") plus a fourth column with a "remove" link.