Index: misc/tabledrag.js
===================================================================
RCS file: /cvs/drupal/drupal/misc/tabledrag.js,v
retrieving revision 1.13
diff -u -r1.13 tabledrag.js
--- misc/tabledrag.js	19 Dec 2007 10:58:35 -0000	1.13
+++ misc/tabledrag.js	5 Feb 2008 06:22:04 -0000
@@ -126,10 +126,20 @@
         }
       });
       $('thead tr', this.table).each(function() {
-        // Remove table header cells entirely (Safari doesn't hide properly).
-        var th = $('th:nth-child('+ headerIndex +')', this);
+        var headerCount = 0;
+        for (var index = 1; headerCount < headerIndex; index++) {
+          var th = $('th:nth-child('+ index +')', this);
+          headerCount += parseInt(th.attr('colspan') ? th.attr('colspan') : 1);
+        }
         if (th.size()) {
-          th.remove();
+          if (th.attr('colspan') > 1) {
+            // If the cell we're supposed to remove has a colspan, we simple reduce it.
+            th.attr('colspan', th.attr('colspan') - 1);
+          }
+          else {
+            // Remove table header cells entirely (Safari doesn't hide properly).
+            th.remove();
+          }
         }
       });
     }
