title: split rows in the 4th column of a table with comma
body: <p>My code to get data from the 4th column of my table.</p>
  
  <pre><code>function getColumn(table_id, col) {
  var tab = document.getElementsByTagName("table")[4];
  var n = tab.rows.length;
  var i, s = null, tr, td;
  if (col &lt; 0) {
      return null;
  }
  
  for (i = 0; i &lt; n; i++) {
      tr = tab.rows[i];
      if (tr.cells.length &gt; col) { // Check that cell exists before you try
          td = tr.cells[col];      // to access it.
          s += ' ' + td.innerText;
      }
  } return s; }
  var txt = getColumn('partTable', 4);
  </code></pre>
  
  <p>It is returning </p>
  
  <blockquote>
    <p>"Jeans A Shirt B Pant T"</p>
  </blockquote>
  
  <p>I would like it to return </p>
  
  <blockquote>
    <p>"Jeans A, Shirt B, Pant T"</p>
  </blockquote>
  
  <p>How is this possible in my code? I do not want to replace the space with ", " since i sometime would have spaces in the number</p>
  
  <p>Thanks</p>