title: How to clone two columns in a table using jQuery
body: <p>I am trying to clone 2 columns from a table to a new table using jQuery.
  The source table is below:</p>
  
  <pre><code>&lt;table id="sourceT"&gt;
      &lt;tr&gt;
          &lt;td&gt;Col 1&lt;/td&gt;
          &lt;td&gt;Col 2&lt;/td&gt;
          &lt;td&gt;Col 3&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;Col 1 - value&lt;/td&gt;
          &lt;td&gt;Col 2 - value&lt;/td&gt;
          &lt;td&gt;Col 3 - value&lt;/td&gt;
      &lt;/tr&gt;
  &lt;/table&gt;
  &lt;table id="targetT"&gt;&lt;/table&gt;
  </code></pre>
  
  <p>What I tried is,</p>
  
  <pre><code>$("#sourceT").find("tr &gt; td:nth-child(1), tr &gt; td:nth-child(2)").each(function () {
      $("#targetT").append($("&lt;tr&gt;&lt;/tr&gt;").append($(this).clone()));
  });
  </code></pre>
  
  <p>I only want to copy first and second columns to a new table like</p>
  
  <pre><code>&lt;table id="targetT"&gt;
      &lt;tr&gt;
          &lt;td&gt;Col 1&lt;/td&gt;
          &lt;td&gt;Col 2&lt;/td&gt;
     &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;Col 1 - value&lt;/td&gt;
          &lt;td&gt;Col 2 - value&lt;/td&gt;
     &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>But using those jquery, I only get like below;</p>
  
  <pre><code>&lt;table id="targetT"&gt;
      &lt;tr&gt;
          &lt;td&gt;Col 1&lt;/td&gt;
      &lt;/td&gt;
      &lt;tr&gt;
          &lt;td&gt;Col 1 - value&lt;/td&gt;
      &lt;/td&gt;
      &lt;tr&gt;
          &lt;td&gt;Col 2&lt;/td&gt;
      &lt;/td&gt;
      &lt;tr&gt;
          &lt;td&gt;Col 2 - value&lt;/td&gt;
      &lt;/td&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>I am not trying to loop all the tr and td's from source table. Coz, my source table is going to be more than thousands rows and more than 50 cols.
  Anyone has got any ideas?</p>