Index: theme.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/theme.inc,v
retrieving revision 1.337.2.2
diff -u -p -r1.337.2.2 theme.inc
--- theme.inc 31 May 2007 05:52:42 -0000 1.337.2.2
+++ theme.inc 16 Sep 2007 23:07:36 -0000
@@ -765,17 +765,20 @@ function theme_table($header, $rows, $at
// Format the table header:
if (count($header)) {
$ts = tablesort_init($header);
- $output .= ' ';
+ /* HTML requires that the thead tag has tr tags in it follwed by tbody
+ tags. Using ternary operator to check and see if we have any rows. */
+ $output .= (count($rows)? ' \n" : "\n");
}
// Format the table rows:
- $output .= "' : ' ');
foreach ($header as $cell) {
$cell = tablesort_header($cell, $header, $ts);
$output .= _theme_table_cell($cell, TRUE);
}
- $output .= " \n";
+ // Using ternary operator to close the tags based on whether or not there are rows
+ $output .= (count($rows)? "