--- ../../drupal/includes/theme.inc	2006-07-13 15:11:36.000000000 +0200
+++ theme.inc	2006-08-02 17:01:07.000000000 +0200
@@ -533,6 +533,14 @@
 
   if (is_array($links)) {
     foreach ($links as $key => $link) {
+      if (!is_array($link['attributes'])) { //no attributes array
+        foreach ($link as $key => $value) {
+          if ($key != 'title'&&$key != 'href')  { //skip title and href
+            $link['attributes'][$key] = $value;   //build attributes array
+          }
+        }
+      }
+
       // Automatically add a class to each link and convert all _ to - for XHTML compliance
       if (isset($link['attributes']) && isset($link['attributes']['class'])) {
         $link['attributes']['class'] .= ' '. str_replace('_', '-', $key);
@@ -541,6 +549,8 @@
         $link['attributes']['class'] = str_replace('_', '-', $key);
       }
 
+
+
       if ($link['href']) {
         $output[] = l($link['title'], $link['href'], $link['attributes'], $link['query'], $link['fragment']);
       }
@@ -764,9 +774,17 @@
       // Build row
       $output .= ' <tr'. drupal_attributes($attributes) .'>';
       $i = 0;
+      $header_keys = array(1,true,'th'); //possibilities of identifying a cell as a header
       foreach ($cells as $cell) {
         $cell = tablesort_cell($cell, $header, $ts, $i++);
-        $output .= _theme_table_cell($cell, 0);
+        $isheader = 0; // default cell not a th
+        if (isset($cell['header'])) {
+          if (in_array($cell['header'],$header_keys)) {
+            $isheader = 1;        //unlock header	
+          }
+          unset($cell['header']); //remove header to not end up in attributes
+        }
+        $output .= _theme_table_cell($cell, $isheader);
       }
       $output .= " </tr>\n";
     }
