Why is my form themed as table not posting data correctly, or displaying correctly?
The problem is that your textfield elements are located under the #rows property of your render array.

Drupal sees any array key beginning with # as a property/attribute, and any array key not beginning with that as an element that needs to be recursively attended to. As such the children you've got under #rows will be ignored by the form builder.

Since theme_table will run on the render array, your form elements will actually be rendered out to the screen, but the form won't have any knowledge of the values (as they are not technically children of the form).

In my experience the best way to do this sort of thing is to use a specific theme function on the element:

function MYMODULE_theme() {
  return array(
    'MYMODULE_textfield_table' =&gt; array(
      'render element' =&gt; 'element'
    )
  );
}

function theme_MYMODULE_textfield_table($vars) {
  $element = $vars['element'];

  $rows = array();
  foreach (element_children($element) as $key) {
    $rows[] = array(
      array('data' =&gt; 'label'),
      array('data' =&gt; $element[$key]['#extra_data']['field_name']),
      array('data' =&gt; $element[$key]['#extra_data']['field_name']),
      array('data' =&gt; render($element[$key]))
    );
  }

  $header = array(t('Field Label'), t('Field Name'), t('Location'), t('Stuff'));
  return theme('table', array('header' =&gt; $header, 'rows' =&gt; $rows));
}


Then in your form function you would use code like the following

$form['things'] = array(
  '#prefix' =&gt; '&lt;div id="things"&gt;',
  '#suffix' =&gt; '&lt;/div&gt;',
  '#tree' =&gt; TRUE,
  '#theme' =&gt; 'MYMODULE_textfield_table'
);

foreach ($type_fields as $field_name =&gt; $attrs) {
  $form['things'][] = array(
    '#type' =&gt; 'textfield',
    '#default_value' =&gt; $attrs['stuff'],
    '#extra_data' =&gt; array('field_name' =&gt; $field_name)
  );
}


After that your textfields should be registered in the form and you should be able to see the value in the $form_state array as normal.