title: How to add rows in middle of a table with jQuery?
body: <p>I've a table which has customers names along with the products they purchased with their prices. So there are multiple records for each customer. This table is simple 3 column table : name, product and price.</p>
  
  <p>What I want to do is:</p>
  
  <p>Put all records belonging to one customer together (I've done it) and just after these rows add one new extra row which would just show total price of all the products each customer has purchased. This row would have empty cell in name and product column. And would have total in price column.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>It's just a plain simple table without any class or ids. customer wise grouped Table is generated by php. So I've a table like this</p>
  
  <pre><code>&lt;table&gt;
      &lt;tr&gt;
          &lt;td&gt; name1 &lt;/td&gt;
          &lt;td&gt; product1 &lt;/td&gt;
          &lt;td&gt; 100 &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt; name1 &lt;/td&gt;
          &lt;td&gt; product2 &lt;/td&gt;
          &lt;td&gt; 200 &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt; name2 &lt;/td&gt;
          &lt;td&gt; product3 &lt;/td&gt;
          &lt;td&gt; 50 &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt; name2 &lt;/td&gt;
          &lt;td&gt; product1 &lt;/td&gt;
          &lt;td&gt; 100 &lt;/td&gt;
      &lt;/tr&gt;
  &lt;/table&gt; 
  </code></pre>
  
  <p>And I want to convert this to :</p>
  
  <pre><code>&lt;table&gt;
      &lt;tr&gt;
          &lt;td&gt; name1 &lt;/td&gt;
          &lt;td&gt; product1 &lt;/td&gt;
          &lt;td&gt; 100 &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt; name1 &lt;/td&gt;
          &lt;td&gt; product2 &lt;/td&gt;
          &lt;td&gt; 200 &lt;/td&gt;
      &lt;/tr&gt;
      &lt;!-- New row --&gt;
      &lt;tr&gt;
          &lt;td&gt;  &lt;/td&gt;
          &lt;td&gt;  &lt;/td&gt;
          &lt;td&gt; 300 &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt; name2 &lt;/td&gt;
          &lt;td&gt; product3 &lt;/td&gt;
          &lt;td&gt; 50 &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt; name2 &lt;/td&gt;
          &lt;td&gt; product1 &lt;/td&gt;
          &lt;td&gt; 100 &lt;/td&gt;
      &lt;/tr&gt;
      &lt;!-- New row --&gt;
      &lt;tr&gt;
          &lt;td&gt;  &lt;/td&gt;
          &lt;td&gt;  &lt;/td&gt;
          &lt;td&gt; 150 &lt;/td&gt;
      &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>