diff --git a/core/misc/tableselect.js b/core/misc/tableselect.js
index 5a88ac20ccc49caf78d3fbbfebb736cc6b932104..fee63a9fd8bd5b509705403423d5d765711a73e5 100644
--- a/core/misc/tableselect.js
+++ b/core/misc/tableselect.js
@@ -17,7 +17,8 @@ Drupal.tableSelect = function () {
   var table = this, checkboxes, lastChecked;
   var strings = { 'selectAll': Drupal.t('Select all rows in this table'), 'selectNone': Drupal.t('Deselect all rows in this table') };
   var updateSelectAll = function (state) {
-    $('th.select-all input:checkbox', table).each(function () {
+    // Update table's select-all checkbox (and sticky header's if available).
+    $(table).prev('table.sticky-header').andSelf().find('th.select-all input:checkbox').each(function() {
       $(this).attr('title', state ? strings.selectNone : strings.selectAll);
       this.checked = state;
     });