title: Copy a HTML table via JavaScript without the headers?
body: <p>Using the JavaScript sample found in this <a href="https://stackoverflow.com/questions/2044616/select-a-complete-table-with-javascript-to-be-copied-to-clipboard">stack overflow post</a> you can have a button that automatically selects a table.  This selected table can then be copied to the  clipboard.</p>
  
  <p>My users will be copying this data into an Excel  template  and do not need the header information (<code>&lt;th&gt;&lt;/th&gt;</code>  or <code>&lt;thead&gt;&lt;/thead&gt;</code>).</p>
  
  <p>My table looks something like this:</p>
  
  <pre><code>&lt;table class="sortable"&gt;
  &lt;thead&gt;
    &lt;tr&gt;&lt;th&gt;Person&lt;/th&gt;&lt;th&gt;Monthly pay&lt;/th&gt;&lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;&lt;td&gt;Bob&lt;/td&gt;&lt;td&gt;£12,000&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td&gt;Doug&lt;/td&gt;&lt;td&gt;£8,500&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td&gt;Sam&lt;/td&gt;&lt;td&gt;£9,200&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td&gt;Nick&lt;/td&gt;&lt;td&gt;£15,300&lt;/td&gt;&lt;/tr&gt;
  &lt;/tbody&gt;
  &lt;tfoot&gt;
    &lt;tr&gt;&lt;td&gt;TOTAL&lt;/td&gt;&lt;td&gt;£45,000&lt;/td&gt;&lt;/tr&gt;
  &lt;/tfoot&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p><strong>How would I go about unselecting the header information?</strong></p>
  
  <p><strong>UDPATE1</strong></p>
  
  <p>The key is to select the tbody (assuming you Do not want tfoot).</p>
  
  <pre><code>&lt;input type="image" src="table.png" name="image" onclick="selectElementContents( document.getElementById('theebody') );"&gt;
  </code></pre>