I have a table that I write rows to rows[0]. The added rows are all classed 'Itemrow'. Cells[8] of any 'itemrow' already add to the innerHTML of cell id 'subtotal'. This works fine. The problem is that when I delete any of the rows cells[8] of the remaining rows no longer equal the innerHTML of 'subtotal'. Infact they are all different even though 'subtotal' changes correctly. What I'd like is that all cells[8] of any remaining 'itemrows' equal that of 'subtotal'.
deleterow()
Code:
var sTotal=sumsubtotal();
var addrowsubtotal=itemrow.insertCell(7);
addrowsubtotal.setAttribute('colspan','1');
addrowsubtotal.setAttribute('title','Subtotal cost of your order.');
addrowsubtotal.className='rowsubtotal';
addrowsubtotal.appendChild(document.createTextNode(subtotal.innerHTML));

var addclear=itemrow.insertCell(8);
addclear.setAttribute('colspan','1');
addclear.className='clear';
addclear.setAttribute('align','center');
addclear.innerHTML='<a title="Remove this item" class="removeitem" onclick="deleterow(this);">[x]</a>';
//relavent part of 'addrow()'??

function sumsubtotal(){
var cartitems=document.getElementsByClassName('itemrow');
var itemrows=cartitems;
var sTotal=0.0;
for(var i=0;i<itemrows.length;i++)
{
var itemrow=itemrows[i];
var price=itemrow.cells[4];
var quantity=itemrow.cells[5].getElementsByTagName('input')[0].value;
var cost=itemrow.cells[6].innerHTML;
sTotal+=Number(cost) || 0;
multiply=price*quantity;
}
cost=parseFloat(multiply).toFixed(2);
subtotal.innerHTML=numberFormat(parseFloat(sTotal).toFixed(2));
ordersum.innerHTML=subtotal.innerHTML;
noofitems.innerHTML=itemrows.length;
}

function deleterow(a) {
// remove row that works
var row=a.parentNode.parentNode;
row.parentNode.removeChild(row);
var sTotal=sumsubtotal( );//works on cell id 'subtotal' not on remaining 'itemrow' cells[8]
EvalSound4();
}
Could realy use some fresh eyes on this.