Index: theme.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/theme.inc,v
retrieving revision 1.576
diff -u -r1.576 theme.inc
--- theme.inc	17 Feb 2010 08:50:49 -0000	1.576
+++ theme.inc	23 Feb 2010 11:34:33 -0000
@@ -1757,7 +1757,16 @@
 
   // Add the 'empty' row message if available.
   if (!count($rows) && $empty) {
-    $rows[] = array(array('data' => $empty, 'colspan' => count($header), 'class' => array('empty', 'message')));
+    $header_count = 0;
+    foreach ($header as $header_cell) {
+      if (is_array($header_cell)) {
+        $header_count += isset($cell['colspan']) ? $cell['colspan'] : 1;
+      }
+      else {
+        $header_count++;
+      }
+    }
+    $rows[] = array(array('data' => $empty, 'colspan' => $header_count, 'class' => array('empty', 'message')));
   }
 
   // Format the table rows:

