title: Javascript array to html table
body: <p>I want to make a html table from an array. I want to use the loop function to do this. But I struggle to find out how I can loop an array to a html table. I want have the name of the countries in the first section and "country" on top of the countries. In the last section I want to have the Capitals and "Capital" on top.</p>
  
  <p>Here is my html code:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
  
      &lt;script&gt;
  
      var country = ["Norway", "Sweden", "Denmark"];
      var capital = ["Oslo", "Stockholm" , "Copenhagen"]
  
  
  
  
      &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>