I Have here an two HTML Table that computes the total per column.
Here's my problem
I don't know how to get the grand total of two tables.
I want to behave my table when you change the numbers in cell I want the total to recompute on keypress.
And also any idea how can I simplify my JavaScript codes.
Here's my code for my first table. Please see the link of my fiddle below for the complete codes. Thank you.
<table style="border:1px solid purple">
<tr id = "Tr1">
<td><input class="cell2" type="text" name="cell2" value="SAMPLE2" /></td>
<td><input class="cell3" type="text" name="cell3" value="267314.36"></td>
<td><input class="cell4" type="text" name="cell4" value="5.95"></td>
<td><input class="cell5" type="text" name="cell5" value ="1" ></td>
<td><input class="cell6" type="text" name="cell6" value="267314.36"></td>
<td><input class="cell7" type="text" name="cell7" value="5.95"></td>
<td><input class="cell8" type="text" name="cell8" value=""></td>
<td><input class="cell9" type="text" name="cell9" value="1"></td>
<td><input class="cell10" type="text" name="cell10" value=""></td>
<td><input class="cell11" type="text" name="cell11" value=""></td>
</tr>
<tr id = "Tr2">
<td><input class="cell2" type="text" name="cell2" value="SAMPLE 3" /></td>
<td><input class="cell3" type="text" name="cell3" value="259528.50"></td>
<td><input class="cell4" type="text" name="cell4" value="6.27"></td>
<td><input class="cell5" type="text" name="cell5" value ="2" ></td>
<td><input class="cell6" type="text" name="cell6" value="519057.00"></td>
<td><input class="cell7" type="text" name="cell7" value="12.54"></td>
<td><input class="cell8" type="text" name="cell8" value="155717.10"></td>
<td><input class="cell9" type="text" name="cell9" value="1"></td>
<td><input class="cell10" type="text" name="cell10" value="155717.10"></td>
<td><input class="cell11" type="text" name="cell11" value="6.27"></td>
</tr>
<tr id = "Tr9">
<td>TOTAL</td>
<td></td>
<td></td>
<td><div class = "" id = "total1">0.00</td>
<td><div class = "" id = "total2">0.00</td>
<td><div class = "" id = "total3">0.00</td>
<td></td>
<td><div class = "" id = "total4">0.00</td>
<td><div class = "" id = "total5">0.00</td>
<td><div class = "" id = "total6">0.00</td>
</tr>
</table>
Here's a fiddle for my code and sample demo.