title: How to insert table rows and columns with 2d array
body: <p>SO I have 2 arrays which are 
      var num = ["1", "2", "3"];
      var cars = ["Saab", "Volvo", "BMW"];<br>
  and I made a button where it'll add rows and column and place the values of my 2 arrays in the table. HoweverIdon't know how to make it into a 2d array and display it on my table. 
    
      </p>
  
  <pre><code>&lt;button onclick="myFunction()"&gt;Try it&lt;/button&gt;
  
  &lt;script&gt;
  function myFunction() {
      var table = document.getElementById("myTable");
      var row;
      var t = [][];
      var num = ["1", "2", "3"];
      var cars = ["Saab", "Volvo", "BMW"];
      for (i = 0; i &lt; num.length;i++){
          var row = table.insertRow(i);
          for (x = 0; x &lt; cars[i].length;x++){
              var cell1 = row.insertCell(x);
  </code></pre>
  
  <p>after this part i don't know what to do and it doesn't work. How can I combine the arrays and make it display it in the table for eg(t[0][0] would be 1 saab)</p>
  
  <pre><code>*cars[i] = num[x];
   cell1.innerHTML = cars[i][x];*
         }
     }
  }
  </code></pre>
  
  <p></p>
  
  <p></p>