title: How can I make more than one column in an HTML table?
body: <p>Here is my code so far and it pulls the data from a CSV. It creates only a single column, but I would like the data to populate into a max of 4 columns with as many rows as necessary. How can I do this?
  --Just to note, the data was originally in a spreadsheet in two columns, Name Data, and the goal is to make each cell be Name:Data.</p>
  
  <pre><code>var test_data = data.split(/\r?\n|\r/);
  var table_data = '&lt;table&gt;';
  var count = 0;
  
  for (var i = 0; i &lt; test_data.length; i++) {
      var cell_data = test_data[i].split(",");
      table_data += '&lt;tr&gt;';
      for (var j = 0; j &lt; cell_data.length - 1; j++) {
          if(i === 0) {
              table_data += '&lt;th colspan="4"&gt;' + cell_data[j] + ":" + cell_data[j + 1] + '&lt;/th&gt;';
          } else {
              table_data += '&lt;td&gt;' + cell_data[j] + ":" + cell_data[j + 1] + '&lt;/td&gt;';
          }
      }
      alert(count);
      if (count == 3) {
          table_data += '&lt;/tr&gt;';
          count = 0;
      } else {
          count += 1;
      }
  
      //table_data += '&lt;/tr&gt;'
  }
  table_data += '&lt;/table&gt;';
  $('#loadData').html(table_data);
  </code></pre>