title: Get InnerText in html table cell and shape it to fit Google Chart API
body: <p>I try to get the cellvalue of a table with a varying number of rows (generated from a 'while' loop in php) and shape them in order to fit in the Google Chart API.</p>
  
  <p>Here is the table :</p>
  
  <pre><code>&lt;thead&gt;
      &lt;tr&gt;
              &lt;th&gt;Sport/Month&lt;/th&gt;
          &lt;th&gt;January&lt;/th&gt;
          &lt;th&gt;February&lt;/th&gt;
          &lt;th&gt;March&lt;/th&gt;
      &lt;/tr&gt; 
  &lt;/thead&gt;
  
  &lt;tbody&gt;
      &lt;tr&gt;
          &lt;td&gt;Tennis&lt;/td&gt;
          &lt;td&gt;Value Tennis.Jan&lt;/td&gt;
          &lt;td&gt;Value Tennis.Feb&lt;/td&gt;       
          &lt;td&gt;Value Tennis.Mar&lt;/td&gt; 
      &lt;/tr&gt;
  
      &lt;tr&gt;
          &lt;td&gt;Football&lt;/td&gt;
          &lt;td&gt;Value Football.Jan&lt;/td&gt;
          &lt;td&gt;Value Football.Feb&lt;/td&gt;
          &lt;td&gt;Value Football.Mar&lt;/td&gt; 
      &lt;/tr&gt;
  
      &lt;tr&gt;
          &lt;td&gt;Sport_n&lt;/td&gt;
          &lt;td&gt;Value Sport_n.Jan&lt;/td&gt;
          &lt;td&gt;Value Sport_n.Feb&lt;/td&gt;
          &lt;td&gt;Value sport_n.Mar&lt;/td&gt;
      &lt;/tr&gt;
  &lt;/tbody&gt;  
  </code></pre>
  
  <p> </p>
  
  <p>I would like to shape it that way:</p>
  
  <pre><code>[
        ['Sport/Month','Tennis','Football','Sport_n'],
        ['Jan',Value Tennis.Jan, Value Football.Jan, Value Sport_n.Jan],
        ['Feb',Value Tennis.Feb, Value Football.Feb, Value Sport_n.Feb],
        ['Mar',Value Tennis.Mar, Value Football.Mar, Value Sport_n.Mar]
      ]
  </code></pre>
  
  <p>In order to integrate it in that script :</p>
  
  <p><a href="https://code.google.com/apis/ajax/playground/?type=visualization#line_chart" rel="nofollow noreferrer">https://code.google.com/apis/ajax/playground/?type=visualization#line_chart</a></p>
  
  <p>I've tried to pick some code from here, using innerText, etc : <a href="https://stackoverflow.com/questions/13074973/how-to-grab-the-values-from-an-html-tables-cells-using-javascript/13075924#13075924">How to grab the values from an HTML table&#39;s cells using JavaScript</a></p>
  
  <p>But my JS knowledge is limited so I couldn't get to what I'd like...</p>