How can I add a class with table theme function to a table header row?
If your current example works I'm assuming you are on drupal 6.

You can add attributes to the header array like this:

$section = array(
  '#theme' =&gt; 'table',
  '#header' =&gt; array(
    array('data' =&gt; 'foo', 'class' =&gt; 'cell-class'),
    array('data' =&gt; 'bar', 'class' =&gt; 'cell-class'),
    'class' =&gt; 'row-class',
  ),
  '#rows' =&gt; $rows,
),