hook_menu, display a form at the top and table at the bottom I'm a bit lost trying to create a page with hook_menu that displays a form and a table below it. Preferably the table should only be displayed after the form has been submitted, but that's not the main issue.

I don't have any issue with displaying the table or the form, but I can't get it to be displayed at the same time on the same page.

I have a my_module_table() function that ends with

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


I then have a function for the form my_module_form($form, &amp;$form_state)

I then have this function to put both of these functions in an array

function my_module_page() {
  $output = array();
  $output['form'] = drupal_get_form('my_module_form');
  $output['table'] = 'my_module_table';
  return $output;
}


Than last I try to create the page and get both the form and the table to render on the page using hook_menu

function my_module_menu() {
  $items = array();

  $items['mymodule'] = array(
    'title' =&gt; 'My module',
    'access callback' =&gt; TRUE,
    'page callback' =&gt; 'mymodule_page',
  );
  return $items;
}


I don't have any issues with the form or table functions, they work fine if I don't try to render both at ones.

Can anybody tel me what I'm doing wrong?
Here's an implementation of my earlier suggestion to append the table as a form markup and rendering the form with table in the menu callback

/**
 * Form builder function
 */
function mymodule_form() {
  $form = array();
  $form['sometext'] = array(
    '#type' =&gt; 'textfield',
    '#title' =&gt; t('Some random textfield'),
    '#default_value' =&gt; 'Hello world',
  );
  $form['tablemarkup'] = array(
    '#markup' =&gt; my_module_table(),
  );
  return system_settings_form($form);
}


/**
 * Callback function for returning form with themed table
 */
function mymodule_page() {
  $output = array();
  $form_data = drupal_get_form('my_module_form');
  $output = drupal_render($form_data);
  return $output;
}

/**
 * Function to return themed table.
 */
function my_module_table() {
  $header = array(
    'data' =&gt; 'Table title',
  );
  $rows[] = array(
    'Table data value',
  );
  return theme('table', array('header' =&gt; $header, 'rows'=&gt; $rows));
}