title: Display array data in a table with 2 columns using Javascript
body: <p>I have the following code - </p>
  
  <pre><code>    &lt;script type="text/javascript"&gt;
  function test() {
      var results = "";
      var myArray    = new Array();
      myArray[0] = "Customizable";
      myArray[1] = "Marketing Collateral";
      myArray[2] = "Online Marketing";
      myArray[3] = "Training";
      myArray[4] = "Event Resources";
      myArray[5] = "Marketing Logos";
      myArray[6] = "Competitive Solution Comparison";
      myArray[7] = "Sales Tools";
      myArray[8] = "Retail Marketing"
      myArray[9] = "Internal";        
  
      results = "&lt;table&gt;";
  for (var i=0; i&lt;myArray.length; i++) {
      results += "&lt;tr&gt;&lt;td&gt;" + myArray[i] + "&lt;/td&gt;";  
      results += "&lt;td&gt;" + myArray[i+1] + "&lt;/td&gt;&lt;/tr&gt;";  
  }
  
  results += "&lt;tr&gt;&lt;td colspan=2&gt;&lt;a href='#' onclick='javascript:RedirectParentToDownload();'&gt;View all content &gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;";
  results += "&lt;table&gt;&lt;br /&gt; &lt;br /&gt;";
  
   var div = document.getElementById("associatedAssets");
      div.innerHTML = results;    
  }
  &lt;/script&gt;
  &lt;body onload="javascript:test();"&gt;
  &lt;div id="associatedAssets"&gt;&lt;/div&gt;
  
  
   &lt;/body&gt;
  </code></pre>
  
  <p>How do I get the output to be rendered as 2 columns and n rows? I want the output to look something like this -</p>
  
  <pre><code>    Customizable      Marketing Collateral
      Online Marketing  Training
      Event Resources   Marketing Logos
      etc
  </code></pre>