diff --git a/theme/theme.inc b/theme/theme.inc
index d4182df..15d7c45 100644
--- a/theme/theme.inc
+++ b/theme/theme.inc
@@ -618,6 +618,11 @@ function template_preprocess_views_view_table(&$vars) {
     $vars['header'] = array();
   }
 
+  // Hide table header if all labels are empty.
+  if (!array_filter($vars['header'])) {
+    $vars['header'] = array();
+  }
+
   $count = 0;
   foreach ($vars['rows'] as $num => $row) {
     $vars['row_classes'][$num] = array();
@@ -637,9 +642,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']);
+    }
   }
 
 
