title: Map a javascript array to html table
body: <p>I would like to create a function that maps a grid, represented as a nested array, to a html table.</p>
  
  <p>For example take list: </p>
  
  <pre><code>[
      ['a', 'b', 'c'],
      ['d', 'e', 'f'],
      ['f', 'g', 'h']
  ]
  </code></pre>
  
  <p>and alter html table to show:</p>
  
  <pre><code>a b c 
  d e f
  f g h
  </code></pre>
  
  <p>Assume table size predetermined and list matches the dimensions. </p>
  
  <p>So something that completes:</p>
  
  <pre><code>table border="1"&gt;
  &lt;tr&gt;
  &lt;td&gt;row 1, cell 1&lt;/td&gt;
  &lt;td&gt;row 1, cell 2&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
  &lt;td&gt;row 2, cell 1&lt;/td&gt;
  &lt;td&gt;row 2, cell 2&lt;/td&gt;
  &lt;/tr&gt;
  &lt;/table&gt;
  
  
  &lt;script&gt;
  update = [['a','b'],['c','d']]
  
  function updateTableHTML(myArray) {
    // maps the list onto the existing table
  }
  
  updateTableHTML(update)
  &lt;/script&gt;
  </code></pre>