summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2007-06-28 09:11:06 +0000
committerDries Buytaert <dries@buytaert.net>2007-06-28 09:11:06 +0000
commit2fe9f45846733ee6e5969fd006ca640650459af3 (patch)
tree1211e2effac6b59594f52f57450a8fe4109a99d3
parentafc700a3f68099468405b75603c8817af837123c (diff)
downloadbrdo-2fe9f45846733ee6e5969fd006ca640650459af3.tar.gz
brdo-2fe9f45846733ee6e5969fd006ca640650459af3.tar.bz2
- Patch #153535 by traxer: according to the XHTML1 Strict specification, it is not allowed to generate empty <tr></tr> tags.
-rw-r--r--includes/theme.inc33
1 files changed, 17 insertions, 16 deletions
diff --git a/includes/theme.inc b/includes/theme.inc
index 367befade..950d8f293 100644
--- a/includes/theme.inc
+++ b/includes/theme.inc
@@ -1153,24 +1153,25 @@ function theme_table($header, $rows, $attributes = array(), $caption = NULL) {
else {
$cells = $row;
}
+ if (count($cells)) {
+ // Add odd/even class
+ $class = $flip[$class];
+ if (isset($attributes['class'])) {
+ $attributes['class'] .= ' '. $class;
+ }
+ else {
+ $attributes['class'] = $class;
+ }
- // Add odd/even class
- $class = $flip[$class];
- if (isset($attributes['class'])) {
- $attributes['class'] .= ' '. $class;
- }
- else {
- $attributes['class'] = $class;
- }
-
- // Build row
- $output .= ' <tr'. drupal_attributes($attributes) .'>';
- $i = 0;
- foreach ($cells as $cell) {
- $cell = tablesort_cell($cell, $header, $ts, $i++);
- $output .= _theme_table_cell($cell);
+ // Build row
+ $output .= ' <tr'. drupal_attributes($attributes) .'>';
+ $i = 0;
+ foreach ($cells as $cell) {
+ $cell = tablesort_cell($cell, $header, $ts, $i++);
+ $output .= _theme_table_cell($cell);
+ }
+ $output .= " </tr>\n";
}
- $output .= " </tr>\n";
}
}