<div id=sum>
<span><!--></span
</div>
<script type="text/javascript">
$("#add").click(function () {
var TR_add='<tr id="'+id+'"><td></td></tr>';
var INPadd='<input type="button" id="delete" value="Удалить" del="'+id+'" />';
var attachadd='\
<td>'+par1+'</td>\
<td>'+par2+'</td>\
<td>'+par3+'</td>\
<td>'+par4+'</td>\
<td>'+par5+'</td>\
<td>'+par6+'</td>\
<td id="potoktd">\'+par7+'</td>\
<td id="archivetd">'+par8.toFixed(0)+'</td>\
<td>'+INPadd+'</td>'
$("#tableName").append(TR_add);
$('#'+id+':first').html(attachadd);
id++; sum = 0;
for (var j=1; j<id; j++) {
sum += parseFloat($("table#tableName tr:eq("+j+") td:eq(6)").html());
};
alert(sum);
$("div #sum span").text(sum);
});
</script>