diff --git a/core/modules/views/templates/views-view-table.html.twig b/core/modules/views/templates/views-view-table.html.twig
index fe6be75..3dde8c2 100644
--- a/core/modules/views/templates/views-view-table.html.twig
+++ b/core/modules/views/templates/views-view-table.html.twig
@@ -72,7 +72,11 @@
             %}
           {% endif %}
           <th{{ column.attributes.addClass(column_classes).setAttribute('scope', 'col') }}>
-            {{ column.content }}
+            {%- if column.wrapper_element -%}
+              <{{ column.wrapper_element }}>{{ column.content }}{{ column.sort_indicator }}</{{ column.wrapper_element }}>
+            {%- else -%}
+              {{ column.content }}{{ column.sort_indicator }}
+            {%- endif %}
           </th>
         {% endfor %}
       </tr>
@@ -93,7 +97,12 @@
             {% endfor %}
           {% endif %}
           <td{{ column.attributes.addClass(column_classes) }}>
-            {{ column.content }}
+            {{- column.content }}{{ column.separator -}}
+            {%- if column.wrapper_element -%}
+              <{{ column.wrapper_element }}>{{ column.field_output }}</{{ column.wrapper_element }}>
+            {%- else -%}
+              {{- column.field_output -}}
+            {%- endif %}
           </td>
         {% endfor %}
       </tr>
diff --git a/core/modules/views/views.theme.inc b/core/modules/views/views.theme.inc
index 4853613..45bf25d 100644
--- a/core/modules/views/views.theme.inc
+++ b/core/modules/views/views.theme.inc
@@ -469,7 +469,7 @@ function template_preprocess_views_view_table(&$variables) {
 
     // Render the header labels.
     if ($field == $column && empty($fields[$field]->options['exclude'])) {
-      $label = SafeMarkup::checkPlain(!empty($fields[$field]) ? $fields[$field]->label() : '');
+      $label = !empty($fields[$field]) ? $fields[$field]->label() : '';
       if (empty($options['info'][$field]['sortable']) || !$fields[$field]->clickSortable()) {
         $variables['header'][$field]['content'] = $label;
       }
@@ -482,12 +482,10 @@ function template_preprocess_views_view_table(&$variables) {
 
         $title = t('sort by @s', array('@s' => $label));
         if ($active == $field) {
-          $tablesort_indicator = array(
+          $variables['header'][$field]['sort_indicator'] = array(
             '#theme' => 'tablesort_indicator',
             '#style' => $initial,
           );
-          $markup = drupal_render($tablesort_indicator);
-          $label = SafeMarkup::set($label . $markup);
         }
 
         $query['order'] = $field;
@@ -521,7 +519,7 @@ function template_preprocess_views_view_table(&$variables) {
       if ($variables['header'][$field]['content']) {
         $element_label_type = $fields[$field]->elementLabelType(TRUE, TRUE);
         if ($element_label_type) {
-          $variables['header'][$field]['content'] = '<' . $element_label_type . '>' . $variables['header'][$field]['content'] . '</' . $element_label_type . '>';
+          $variables['header'][$field]['wrapper_element'] = $element_label_type;
         }
         // Improves accessibility of complex tables.
         $variables['header'][$field]['attributes']['id'] = Html::getUniqueId('view-' . $field . '-table-column');
@@ -580,7 +578,7 @@ function template_preprocess_views_view_table(&$variables) {
         $field_output = $handler->getField($num, $field);
         $element_type = $fields[$field]->elementType(TRUE, TRUE);
         if ($element_type) {
-          $field_output = SafeMarkup::set('<' . $element_type . '>' .  SafeMarkup::escape($field_output) . '</' . $element_type . '>');
+          $column_reference['wrapper_element'] = $element_type;
         }
 
         // Only bother with separators and stuff if the field shows up.
@@ -588,17 +586,13 @@ function template_preprocess_views_view_table(&$variables) {
           // Place the field into the column, along with an optional separator.
           if (!empty($column_reference['content'])) {
             if (!empty($options['info'][$column]['separator'])) {
-              $safe_content = SafeMarkup::escape($column_reference['content']);
-              $safe_separator = Xss::filterAdmin($options['info'][$column]['separator']);
-              $column_reference['content'] = SafeMarkup::set($safe_content . $safe_separator);
+              $column_reference['separator'] = Xss::filterAdmin($options['info'][$column]['separator']);
             }
           }
           else {
             $column_reference['content'] = '';
           }
-          $safe_content = SafeMarkup::escape($column_reference['content']);
-          $safe_field_output = SafeMarkup::escape($field_output);
-          $column_reference['content'] = SafeMarkup::set($safe_content . $safe_field_output);
+          $column_reference['field_output'] = $field_output;
         }
       }
       $column_reference['attributes'] = new Attribute($column_reference['attributes']);
