[Solved] How to sum of table amount in javascript? [closed]

Like this:

        var tr = "";
        var totalAmount = "";
        var total = 0;  //this your total
        var footerTr = "";
        for(var i=1; i<=31; i++){
            tr += `<tr>

                totalAmount += `${i*2}+`;
                total += i*2;  //this your total
         totalAmount = totalAmount.substring(0, totalAmount.length - 1); // remove last plus
         totalAmount += '='+total;
         footerTr = `<tr>

         $('#saving_calc tbody').append(tr);
         $('#saving_calc tfoot').append(footerTr);
         console.log(total);//this your total 
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css">
  <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.slim.min.js"></script>
 <table class="table table-bordered"id="saving_calc" >


solved How to sum of table amount in javascript? [closed]