From 2fe9f45846733ee6e5969fd006ca640650459af3 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Thu, 28 Jun 2007 09:11:06 +0000 Subject: - Patch #153535 by traxer: according to the XHTML1 Strict specification, it is not allowed to generate empty tags. --- includes/theme.inc | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) (limited to 'includes') 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 .= ' '; - $i = 0; - foreach ($cells as $cell) { - $cell = tablesort_cell($cell, $header, $ts, $i++); - $output .= _theme_table_cell($cell); + // Build row + $output .= ' '; + $i = 0; + foreach ($cells as $cell) { + $cell = tablesort_cell($cell, $header, $ts, $i++); + $output .= _theme_table_cell($cell); + } + $output .= " \n"; } - $output .= " \n"; } } -- cgit v1.2.3