theme('table'...) function doesn't print the table header
You are using theme('table',array('headers' =&gt; $header,'rows' =&gt; $rows)), while you should be using theme('table',array('header' =&gt; $header,'rows' =&gt; $rows)). theme_table() looks for a property called header, not headers.


  Parameters
  
  $variables: An associative array containing:
  
  
  header: An array containing the table headers. Each element of the array can be either a localized string or an associative array with the following keys:
  
  
  "data": The localized title of the table column.
  "field": The database field represented in the table column (required if user is to be able to sort on this column).
  "sort": A default sort order for this column ("asc" or "desc").
  Any HTML attributes, such as "colspan", to apply to the column header cell.
  
  rows: An array of table rows. Every row is an array of cells, or an associative array with the following keys:
  
  
  "data": an array of cells
  Any HTML attributes, such as "class", to apply to the table row.
  "no_striping": a boolean indicating that the row should receive no 'even / odd' styling. Defaults to FALSE.
  
  
  
  Each cell can be either a string or an associative array with the following keys:
  
  
  "data": The string to display in the table cell.
  "header": Indicates this cell is a header.
  Any HTML attributes, such as "colspan", to apply to the table cell.