title: Combine Multiple row into single row using jquery
body: <p>I have a table like this</p>
  
  <pre><code>ItemName  header1  header2  header3
  
  item1      0        0        1
  
  item2      1        0        0
  
  item1      1        0        0
  
  item3      1        0        0
  
  item2      0        1        0
  
  item1      0        1        0 
  </code></pre>
  
  <p>I need to combine the table rows like this </p>
  
  <pre><code>ItemName  header1 header2  header3
  
  item1       1       1        1
  item2       1       1        0
  item3       1       0        0 
  </code></pre>
  
  <p>Firstly i converted table into array of json using</p>
  
  <pre><code>var table = $('#Tbl').tableToJSON();
  </code></pre>
  
  <p>Now i have array of jsons and have to sum the duplicated rows</p>
  
  <pre><code>table=[{[{ItemName:item1},{header1:0},{header2:0},{header3:1}]},{[{ItemName:item2},{header1:1},{header2:0},{header3:0}]},{[{ItemName:item1},{header1:1},{header2:0},{header3:0}]},{[{ItemName:item3},{header1:1},{header2:0},{header3:0}]},{[{ItemName:item2},{header1:0},{header2:1},{header3:0}]},{[{ItemName:item1},{header1:0},{header2:1},{header3:0}]}];
  </code></pre>
  
  <p>i need the output like this</p>
  
  <pre><code>table=[{[{ItemName:item1},{header1:1},{header2:1},{header3:1}]},{[{ItemName:item2},{header1:1},{header2:1},{header3:0}]},{[{ItemName:item3},{header1:1},{header2:0},{header3:0}]}];
  </code></pre>
  
  <p>any answers please help me</p>