title: Move column (including thead and td) to a new position
body: <p>I have a table like this, column 3 is a column of checkbox</p>
  
  <pre><code>header1   header2     header3
   cell1     cell2     checkbox3
   cell1     cell2     checkbox3
   cell1     cell2     checkbox3
  </code></pre>
  
  <p>I want to move column 3 to after column 1 like this</p>
  
  <pre><code>header1     header3      header2
   cell1     checkbox3      cell2
   cell1     checkbox3      cell2
   cell1     checkbox3      cell2
  </code></pre>
  
  <p>This is what I tried so far:</p>
  
  <pre><code>$('thead tr:nth-child(2)').insertAfter('thead tr:nth-child(0)');
  $('tbody tr:nth-child(2)').insertAfter('tbody tr:nth-child(0)');
  </code></pre>
  
  <p>Code for table:</p>
  
  <pre><code>&lt;table&gt;
    &lt;thead&gt;
     &lt;tr&gt;
      &lt;th&gt;header1&lt;/th&gt;
      &lt;th&gt;header2&lt;/th&gt;
      &lt;th&gt;header3&lt;/th&gt;
     &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;
     &lt;tr&gt;
      &lt;td&gt;cell1&lt;/td&gt;
      &lt;td&gt;cell2&lt;/td&gt;
      &lt;td&gt;&lt;input type="checkbox" /&gt;checkbox3&lt;/td&gt;
     &lt;/tr&gt;
     &lt;tr&gt;
      &lt;td&gt;cell1&lt;/td&gt;
      &lt;td&gt;cell2&lt;/td&gt;
      &lt;td&gt;&lt;input type="checkbox" /&gt;checkbox3&lt;/td&gt;
     &lt;/tr&gt;
     &lt;tr&gt;
      &lt;td&gt;cell1&lt;/td&gt;
      &lt;td&gt;cell2&lt;/td&gt;
      &lt;td&gt;&lt;input type="checkbox" /&gt;checkbox3&lt;/td&gt;
     &lt;/tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>But it didn't work, any idea that I can solve this?</p>