title: Dynamic table HTML Javascript
body: <p>I need to read an existing table with Javascript and then copy and paste it in a popup.
  After that I've done that, I need to dynamically change the table.
  The copied table in the popup must have the same rows, but it must have also a fixed height.
  The table to copy does not a have a fixed amount of rows.
  The popup content must be printed on paper, so I cannot apply a simple overflow to
  the table.
  I don't want to reduce the font size to insert everything in the fixed space, but I would like to dynamically extend the table width if the readed content is to long.
  For example, here is my starting table (6 rows):</p>
  
  <pre><code>H1   H2   H3
  TD1  TD1 TD1 
  TD2  TD2 TD2 
  TD3  TD2 TD3 
  TD4  TD4 TD4 
  TD5  TD5 TD5 
  TD6  TD6 TD6 
  </code></pre>
  
  <p>The copied table should be something like:</p>
  
  <pre><code>H1   H2   H3 H1   H2  H3
  TD1  TD1 TD1 TD4  TD4 TD4 
  TD2  TD2 TD2 TD5  TD5 TD5 
  TD3  TD2 TD3 TD6  TD6 TD6 
  </code></pre>
  
  <p>Or</p>
  
  <pre><code>H1   H2   H3 
  TD1  TD1 TD1 TD4  TD4 TD4 
  TD2  TD2 TD2 TD5  TD5 TD5 
  TD3  TD2 TD3 TD6  TD6 TD6 
  </code></pre>
  
  <p>(I do not care to repeat the headers).</p>
  
  <p>What's the fastest/smartest way to do that?</p>