diff options
author | Dries Buytaert <dries@buytaert.net> | 2007-06-28 09:11:06 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2007-06-28 09:11:06 +0000 |
commit | 2fe9f45846733ee6e5969fd006ca640650459af3 (patch) | |
tree | 1211e2effac6b59594f52f57450a8fe4109a99d3 | |
parent | afc700a3f68099468405b75603c8817af837123c (diff) | |
download | brdo-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.inc | 33 |
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"; } } |