table append 2
by Rich Costello
HTML
<div id="paymentplantable">
<table border="1" style="width: 60%;">
<tbody>
<tr>
<th>Payment No.</th>
<th>Amount</th>
<th>Due Date</th>
<th> Edit </th>
<th>Remove</th>
</tr>
<tr>
<td>1</td>
<td>16050.0</td>
<td>Monday 28 November, 2011</td>
<td class="edit_in_table" style="height:20px; width:20px;"></td>
<td id="/starburst/invoices/removeInstallment/6/14" class="remove" style="height:20px; width:20px;"></td>
</tr>
</tbody>
</table>
</div>
<input type="button" value="Add Row" id="btnAddRow" />
JavaScript
var NextRowID = 1;
$('#btnAddRow').click(function (e) {
e.preventDefault();
NextRowID++;
$("#paymentplantable table tbody").append("<tr><td>" + NextRowID + "</td><td>0.00</td><td>Whatever</td><td></td><td></td></tr>");
return false;
});