title: How to clone a whole table in Javascript?
body: <p>I tried to use cloneNode mentionned here <a href="https://stackoverflow.com/questions/771571/copy-the-content-of-one-table-into-another">Copy the content of one table into another</a> but Chrome says cloneNode is not a function</p>
  
  <p><a href="https://jsfiddle.net/4wczdykc/1/" rel="nofollow noreferrer">https://jsfiddle.net/4wczdykc/1/</a></p>
  
  <pre><code>&lt;table&gt;
      &lt;thead&gt;
  
          &lt;tr&gt;
              &lt;th scope="col" colspan="1"&gt;TABLE TO CLONE&lt;/th&gt;
          &lt;/tr&gt;
  
          &lt;tr&gt;
              &lt;th&gt;Column&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;/td&gt;                         
          &lt;/tr&gt;
      &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>script:</p>
  
  <pre><code>myTable = document.getElementsByTagName("Table")[0];
  myClone = myTable.cloneNode(true);
  document.body.appendChild(myClone);
  </code></pre>