diff --git a/misc/tableselect.js b/misc/tableselect.js
index fee63a9..54aa64e 100644
--- a/misc/tableselect.js
+++ b/misc/tableselect.js
@@ -57,6 +57,10 @@ Drupal.tableSelect = function () {
     // Keep track of the last checked checkbox.
     lastChecked = e.target;
   });
+
+  // If all checkboxes are checked on page load, make sure the select-all one
+  // is checked too, otherwise keep unchecked.
+  updateSelectAll((checkboxes.length == $(checkboxes).filter(':checked').length));
 };
 
 Drupal.tableSelectRange = function (from, to, state) {
