title: Create html table from comma separated strings javascript
body: <p>I am trying to write a Javascript function which writes the text to (eventually) create the following html tables (I will be passing different length arguments to it to create hundreds of tables):</p>
  
  <pre><code>&lt;table&gt;
      &lt;tr&gt;&lt;td&gt;&lt;u&gt;School&lt;/u&gt;&lt;/td&gt;
      &lt;td&gt;&lt;u&gt;Percent&lt;/u&gt;&lt;/td&gt;
      &lt;tr&gt;&lt;td&gt;School 1: &lt;/td&gt;
      &lt;td&gt;Percent1&lt;/td&gt;&lt;/tr&gt;
      &lt;tr&gt;&lt;td&gt;School 2: &lt;/td&gt;
      &lt;td&gt;Percent2&lt;/td&gt;&lt;/tr&gt;
      &lt;tr&gt;&lt;td&gt;School 3: &lt;/td&gt;
      &lt;td&gt;Percent3&lt;/td&gt;&lt;/tr&gt;  
  &lt;/table&gt;
  </code></pre>
  
  <p>The inputs that I have are comma separated strings:</p>
  
  <pre><code>var school_list = "School 1, School 2, School 3"
  var pct_list = "Percent1, Percent2, Percent3"
  </code></pre>
  
  <p>The function needs to be passed school_list and pct_list, and return a string of the html table code above.</p>