Webform table element and Webform
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.