A quick solution would be to do something like this:
$header = array(
    array('field' => 'created', 'sort' => 'desc'),
    array('data' => t('title'), 'field' => 'title'),
);
$header_sort = $header;
$header_sort[] = array(...); // Add the default sort.
Then you can use header_sort for the sql and $header for the theming of the table.
                  googletorp
                   2010-10-27 10:27:41