diff --git a/core/includes/theme.inc b/core/includes/theme.inc
index 3483330..1418caf 100644
--- a/core/includes/theme.inc
+++ b/core/includes/theme.inc
@@ -2155,7 +2155,7 @@ function theme_table($variables) {
     $ts = tablesort_init($header);
     // HTML requires that the thead tag has tr tags in it followed by tbody
     // tags. Using ternary operator to check and see if we have any rows.
-    $output .= (count($rows) ? ' <thead><tr>' : ' <tr>');
+    $output .= (count($rows) ? ' <thead><th scope="col">' : ' <th scope="col">');
     $i = 0;
     foreach ($header as $cell) {
       $i++;
@@ -2172,10 +2172,15 @@ function theme_table($variables) {
         }
       }
       $cell = tablesort_header($cell, $header, $ts);
+      if (is_array($cell)) {
+        $cell['scope'] = 'col';
+      } else {
+        $cell = array('data' => $cell, 'scope' => 'col');
+      }
       $output .= _theme_table_cell($cell, TRUE);
     }
     // Using ternary operator to close the tags based on whether or not there are rows
-    $output .= (count($rows) ? " </tr></thead>\n" : "</tr>\n");
+    $output .= (count($rows) ? " </th></thead>\n" : "</th>\n");
   }
   else {
     $ts = array();
@@ -2215,6 +2220,16 @@ function theme_table($variables) {
         $i = 0;
         foreach ($cells as $cell) {
           $i++;
+          if(($i==0)) {
+            if (is_array($cell)) {
+              $cell['scope'] = 'row';
+              $row_header = TRUE;
+            } else {
+              $cell = array('data' => $cell, 'scope' => 'row');
+            }
+          } else {
+            $row_header = FALSE;
+          }
           // Add active class if needed for sortable tables.
           $cell = tablesort_cell($cell, $header, $ts, $i);
           // Copy RESPONSIVE_PRIORITY_LOW/RESPONSIVE_PRIORITY_MEDIUM
@@ -2227,7 +2242,7 @@ function theme_table($variables) {
               $cell = array('data' => $cell, 'class' => $responsive[$i]);
             }
           }
-          $output .= _theme_table_cell($cell);
+          $output .= _theme_table_cell($cell, $row_header);
         }
         $output .= " </tr>\n";
       }
diff --git a/core/modules/system/lib/Drupal/system/Tests/Form/ElementsTableSelectTest.php b/core/modules/system/lib/Drupal/system/Tests/Form/ElementsTableSelectTest.php
index d778669..1232423 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Form/ElementsTableSelectTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Form/ElementsTableSelectTest.php
@@ -75,7 +75,7 @@ function testTableselectColSpan() {
 
     // There should be three labeled column headers and 1 for the input.
     $table_head = $this->xpath('//thead');
-    $this->assertEqual(count($table_head[0]->tr->th), 4, 'There are four column headers');
+    $this->assertEqual(count($table_head[0]->tr->th[0]), 4, 'There are four column headers');
 
     $table_body = $this->xpath('//tbody');
     // The first two body rows should each have 5 table cells: One for the
diff --git a/core/modules/system/lib/Drupal/system/Tests/Theme/TableTest.php b/core/modules/system/lib/Drupal/system/Tests/Theme/TableTest.php
index 392959d..28d7285 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Theme/TableTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Theme/TableTest.php
@@ -64,6 +64,6 @@ function testThemeTableWithEmptyMessage() {
     );
     $this->content = theme('table', array('header' => $header, 'rows' => array(), 'empty' => t('No strings available.')));
     $this->assertRaw('<tr class="odd"><td colspan="3" class="empty message">No strings available.</td>', 'Correct colspan was set on empty message.');
-    $this->assertRaw('<thead><tr><th>Header 1</th>', 'Table header was printed.');
+    $this->assertRaw('<thead><tr><th scope="col">Header 1</th>', 'Table header was printed.');
   }
 }
