I have found this javascript code from somewhere.to do the same.. But the problem is . I am confused how should I call this function in my actual table rows and coloms...
Expand|Select|Wrap|Line Numbers
- <script language="javascript">
- function sumup( o ) {
- var t = [], cell,
- row = document.getElementById( 'sumtable' ).rows,
- i = row.length - 1,
- lastrow = row[i];
- while(i--) {
- cell = row[i].cells; j = cell.length;
- while(j--) {
- if( !t[j] ) { t[j] = 0; }
- t[j] += parseFloat( cell[j].firstChild.nodeValue ) || 0;
- }
- }
- j = t.length; while(j--) {
- if( lastrow.cells[j] ) { lastrow.cells[j].firstChild.nodeValue = t[j]; }
- }
- o.disabled = true;
- }
- </script>
PLease please help me... as i m new to javascript and programmin