How to render a form in table layout What is the Drupal way of presenting multi-row, multi-column module data to the user in Drupal 6? Nothing jumped out in the API documentation. I was googling for some answers, but they all applied to earlier versions or referenced dead modules.

Am I correct in thinking that the out-of-the-box functionality for the forms API is basically a key::value editing interface? If that's the case, is there a current, well-maintained module to do this, or should I present this data in a different way for the user -- perhaps a view?

Edit I would like this table to have form features for editing the data, such as insert, changing cell data, etc. That's why I thought it would be natural for it to reside in the module's settings, but that table functionality does not appear to be there.
A little bit tricky

function your_form(){
  $form = array();
  ...
  $record_ids = array();

  foreach($record_set as $record){
      $record_ids[$record['id']] = ''; // Collect ids of your record as index
      $form['column1'][$record['id']] = array('#value' =&gt; $record['field1']);
      $form['column2'][$record['id']] = array('#value' =&gt; $record['field2']);
      $form['column3'][$record['id']] = array('#value' =&gt; $record['field3']);
  }

  $form['select'] = array(
      '#type' =&gt; 'checkboxes',
      '#options' =&gt; $item_ids,
  );

  $form['#theme'] = 'render_your_form'; // Theme registry function to render this form
}


Define theme_registry

function your_module_theme(){
   ...
   $theme['render_your_form'] = array(
       'arguments' =&gt; array('form' =&gt; array()),
   );
   return $theme;
}


Now write your theme handler

function theme_render_your_form($form=array()){
   $head = array('Select', 'Title Col 1', 'Title Col 2','Title Col 3');
   $rows = array();
   foreach(element_children($form['select']) as $id){
       $fields = array();
       $fields[] = drupal_render($form['select'][$id]); //This will render a checkbox, omit if not required
       $fields[] = drupal_render($form['column1'][$id]);
       $fields[] = drupal_render($form['column2'][$id]);
       $fields[] = drupal_render($form['column3'][$id]);
       $rows[] = $fields;
   }
   $output = theme('table', $head, $rows); // Theme as table output
   $output .= drupal_render($form); // Render rest of form components. (For D6)
   $output .= drupal_render_children($form); // Render rest of form components (For D7)
   return $output;
}