I need to ensure that the "subtot" row is always appended as the last row in the table. When dynamically adding rows, the "subtot" row appears as the last row the first time, but does not stay at the bottom when more rows are added.
Even though I want the "subtot" row to be the last row and have added a condition to ensure it is only appended once, it still does not consistently remain at the bottom when additional rows are appended.
//ensure that the subtot row is only appended once
if($('.subtot').length < 1){
$('<tr class = "subtot"><td></td><td></td><td></td><td>test</td></tr>').insertAfter('table tbody>tr:last');
}
Scroll down a bit on the jsfiddle to view the code.
Thank you.