diff --git a/replace/tabledrag.js b/replace/tabledrag.js
index 53b8e22..da04312 100644
--- a/replace/tabledrag.js
+++ b/replace/tabledrag.js
@@ -171,7 +171,7 @@ Drupal.tableDrag.prototype.makeDraggable = function(item) {
   // Create the handle.
   var handle = $('<a href="#" class="tabledrag-handle"><div class="handle">&nbsp;</div></a>').attr('title', Drupal.t('Drag to re-order'));
   // Insert the handle after indentations (if any).
-  if ($('td:first .indentation:last', item).after(handle).size()) {
+  if (self.indentEnabled && $('td:first .indentation:first', item).size() && $('td:first .indentation:last', item).after(handle).size()) {
     // Update the total width of indentation in this entire table.
     self.indentCount = Math.max($('.indentation', item).size(), self.indentCount);
   }
