title: How to display contents of a 2-D javaScript Array into HTML Table?
body: <p>JavaScript Code :
  This code has to display two values on each row from result array</p>
  
  <p>Problem : Displays all values in a line</p>
  
  <pre><code> var tablecontent = '&lt;tr&gt;';
   for ( var i=0 ; i&lt;pos; i++)
   {
   tablecontent += "&lt;td&gt;"+result[pos][0]+"&lt;/td&gt;&lt;td&gt;"+result[pos][1]+"&lt;/td&gt;";
   }
   tablecontent = '&lt;/tr&gt;';
   test.innerHTML += tablecontent;
  </code></pre>
  
  <p>HTML Code :</p>
  
  <pre><code>&lt;div id="test"&gt;
  &lt;table&gt; 
      &lt;th&gt; 
        &lt;td&gt;Column 1&lt;/td&gt;
        &lt;td&gt;Column 2&lt;/td&gt;
      &lt;/th&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p></p>