title: create a json array from html table
body: <p>i have C++ program exporting log files as HTML table and I wanted to know if there is any way that i can parse that table(something like this):</p>
  
  <pre><code>&lt;table&gt;
  &lt;tr&gt;&lt;td&gt;id&lt;/td&gt;&lt;td&gt;value1&lt;/td&gt;&lt;td&gt;value2&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;0 &lt;/td&gt;&lt;td&gt;0     &lt;/td&gt;&lt;td&gt;0     &lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;0 &lt;/td&gt;&lt;td&gt;1.5   &lt;/td&gt;&lt;td&gt;2.15  &lt;/td&gt;&lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>into a JSON array (something like this) using a Javascript function:</p>
  
  <pre><code> var chartData = [
              {id:"0",value1:"0",value2:"0"},
              {id:"1",value1:"1.5",value2:"2.15"}];
  </code></pre>
  
  <p>The problem is that I want this function to work for every table given to it, with any possible row or column count(first row is always a header).</p>