title: Clipboard copy of table row
body: <p>I want to copy the row of a table so that it will be easier for me to paste it into the spreadsheet.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$(".copy-btn").click(function() {
    var pid = $(this).closest('.parent-row').attr('id');
    pid.select();
    document.execCommand("copy");
  
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;table border='1'&gt;
    &lt;tr id="row-1" class="parent-row"&gt;
      &lt;td&gt;&lt;button class="copy-btn"&gt;Copy&lt;/button&gt;&lt;/td&gt;
      &lt;td&gt; Tester&lt;/td&gt;
      &lt;td&gt;xsample@example.com&lt;/td&gt;
      &lt;td&gt;12121&lt;/td&gt;
      &lt;td&gt;1000&lt;/td&gt;
      &lt;td&gt;&lt;a class="fancybox" href="/uploads/89197934977.jpeg"&gt;img&lt;/a&gt;&lt;/td&gt;
      &lt;td&gt;2018-07-19&lt;/td&gt;
      &lt;td&gt;&lt;span&gt;new&lt;/span&gt;&lt;/td&gt;
    &lt;/tr&gt;
  
    &lt;tr id="row-2" class="parent-row"&gt;
      &lt;td&gt;&lt;button class="copy-btn"&gt;Copy&lt;/button&gt;&lt;/td&gt;
      &lt;td&gt; Tester 2&lt;/td&gt;
      &lt;td&gt;xsample2@example.com&lt;/td&gt;
      &lt;td&gt;145345&lt;/td&gt;
      &lt;td&gt;1050&lt;/td&gt;
      &lt;td&gt;&lt;a class="fancybox" href="/uploads/89197955551.jpeg"&gt;img&lt;/a&gt;&lt;/td&gt;
      &lt;td&gt;2018-07-20&lt;/td&gt;
      &lt;td&gt;&lt;span&gt;new&lt;/span&gt;&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/table&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>This is what I have tried so far. After clicking the copy button, the function does not copy the table row. </p>
  
  <p>It should paste only <code>Tester</code> <code>xsample@example.com</code> <code>12121</code> <code>1000</code> and <code>2018-07-19</code> (separate cells) when I press <kbd>ctrl</kbd> + <kbd>v</kbd> into the spreadsheet/Excel.
   Any help is much appreciated.</p>