How to use admin table theme with multistep form? I have 1000 records of users with name and checkbox. I want to show the list of users in table theme. I have use 

theme('table', array('header' =&gt; $header, 'rows' =&gt; $rows));


But how to use it with multistep form. Please find the below code.

function getForm() {
$form = array();
$step1 = array();

drupal_add_js("
function checkUncheckAll(theElement){
  var theForm = theElement.form, z = 0;
  for(z=0; z&lt;theForm.length;z++){
    if(theForm[z].type == 'checkbox' &amp;&amp; theForm[z].name != 'checkall'){
      theForm[z].checked = theElement.checked;
    }
  }
}", 'inline');

$step1['user'] = array(
   '#type' =&gt; 'container',
   '#tree' =&gt; TRUE,
   '#prefix' =&gt; '&lt;div id="user"&gt;',
   '#suffix' =&gt; '&lt;/div&gt;',
);
$results = db_query("SELECT* FROM {user_token} ut LEFT JOIN {users} u ON u.uid= ut.uid where u.status=1 and u.uid!=0 group by ut.uid ")-&gt;fetchAll();

foreach($results as $k=&gt;$result)
{
  $user[$result-&gt;uid] = $result-&gt;name;
    $defaults = array_keys($user);
}

 $step1['checkall'] = array(
 '#type' =&gt; 'checkbox',
 '#title' =&gt; t('Select / Unselect all'),
 '#attributes' =&gt; array('onclick' =&gt; 'checkUncheckAll(this);'),
 '#weight' =&gt; -1,
 );

 $step1['user'] = array(
 '#type' =&gt; 'checkboxes',
 '#title' =&gt; t('Send message to listed users'),
 '#options' =&gt; $user,
 //'#default_value' =&gt; $defaults,
 '#attributes' =&gt; array('class' =&gt; array('check_notify_user'))
 );

 $step1['submit']=array(
     '#type'=&gt;'submit',
     '#value'=&gt;t('Next')
 );


$form[] = $step1;

$step2['message'] = array(
  '#type' =&gt; 'textarea',
  '#title' =&gt; 'Message',
  '#description' =&gt; t('No more than 250 words please!'),
  '#wysiwyg' =&gt; false,
  '#attributes' =&gt; array('maxlength' =&gt; 250),
);

$step2['prev'] = array(
  '#type' =&gt; 'submit',
  '#value' =&gt; t('Previous'),
  '#name' =&gt; 'prev',
  '#submit' =&gt; array('custom_previous_submit'),
);

$step2['submit']=array(
    '#type'=&gt;'submit',
    '#value'=&gt;t('Submit')
  );

$form[] = $step2;

return $form;


}
I assume you know how to do the multi-step form. For the table, you can use Drupal's table theme function. If the table contains only markup, you can do something like this:

$form['table'] = array(
  '#theme' =&gt; 'table',
  '#rows' =&gt; $rows,    
  '#empty' =&gt; 'Empty List - No Entries',
  '#header' =&gt; $header,
);


or 

$form['table'] = array ('#value' =&gt; theme('table', $headers, $rows));


You can use this in multistep form also.

If the table contains actual form elements (such as selects, textfields, etc.), you can wrap them in a form element that calls a theme function, like so:

$form['table'] = array ('#theme' =&gt; 'output_table');

$form['table']['element_1'] = array (...);
$form['table']['element_2'] = array (...);


Within 'theme_output_table', generate your $headers and $rows to feed to 'theme_table' by calling 'drupal_render' on the relevant form elements that are children of $form['table'].