title: jquery swap table cells by drag and drop
body: <p>I think the jquery sortable plugin is great:</p>
  
  <p><a href="http://jqueryui.com/draggable/#sortable" rel="nofollow">http://jqueryui.com/draggable/#sortable</a></p>
  
  <p>Unfortunately, I need to use table cells, where you can swap table cells by drag and drop only if the destination cell is in the same column. I think the only way this can be done is if you give all table cells for a column the same class name:</p>
  
  <pre><code>&lt;table id="sortable"&gt;
    &lt;tr&gt;
       &lt;th&gt;column1&lt;/th&gt;
       &lt;th&gt;column2&lt;/th&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
         &lt;td class="column1"&gt;column1&lt;/td&gt;
          &lt;td class="column2"&gt;column2&lt;/td&gt;
     &lt;/tr&gt;
     &lt;tr id="crm-data"&gt;
          &lt;td class="column1"&gt;column1&lt;/td&gt;
          &lt;td class="column2"&gt;column2&lt;/td&gt;
     &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>And then try to contain the drop feature to an element with same class:</p>
  
  <pre><code>  $('#sortable td.column1').draggable({
      containment: ".column1"
    });
  </code></pre>
  
  <p>This does not work at all. The td is no longer draggable. </p>
  
  <p>What is the best way to drag and drop table cells within a contained column?</p>