From 96840349b7b1d0fc94fdd0e82696718b51d4ff3f Mon Sep 17 00:00:00 2001
Message-Id: <96840349b7b1d0fc94fdd0e82696718b51d4ff3f.1343482264.git.dmitriy.trt@gmail.com>
From: "Dmitriy.trt" <dmitriy.trt@gmail.com>
Date: Sat, 28 Jul 2012 20:30:55 +0700
Subject: [PATCH] Issue #1309026: don't add colspan to the row with empty text
 on empty headers

---
 theme/theme.inc |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/theme/theme.inc b/theme/theme.inc
index d4182df..343e996 100644
--- a/theme/theme.inc
+++ b/theme/theme.inc
@@ -637,9 +637,13 @@ function template_preprocess_views_view_table(&$vars) {
   $vars['classes_array'] = array('views-table');
   if (empty($vars['rows']) && !empty($options['empty_table'])) {
     $vars['rows'][0][0] = $view->display_handler->render_area('empty');
-    // Calculate the amounts of rows with output.
-    $vars['field_attributes'][0][0]['colspan'] = count($vars['header']);
     $vars['field_classes'][0][0] = 'views-empty';
+    $vars['field_attributes'][0][0] = array();
+
+    if (!empty($vars['header'])) {
+      // Calculate the amounts of rows with output.
+      $vars['field_attributes'][0][0]['colspan'] = count($vars['header']);
+    }
   }
 
 
-- 
1.7.10.4

