javascript:(function() {
    var number_re = /([0-9.+-]+)/;
    $('table').each(function() {
        var $table = $(this);
        var totals = $.map($('table:first tr:first').find('td,th'), function() { return '' });
        $table.find('tr').each(function() {
            $(this).children('td,th').each(function(i) {
                var match = number_re.exec($(this).text().replace(',', ''));
                if (match) {
                    var value = parseFloat(match[1]);
                    if (!isNaN(value)) {
                        if (totals[i] == '') {
                            totals[i] = value;
                        }
                        else {
                            totals[i] += value;
                        }
                    }
                }
            });
        });
        $('<tr/>').html($.map(totals, function(value) { return '<td>' + value + '</td>' }).join('')).appendTo($table);
        $table.find('tr:last td').css('border-top', '2px solid #EEEEEE').css('font-weight', 'bold').eq(0).text('TOTAL');
    })
})()