title: DataTables: Add a row for totals and a row for percentages
body: <p>I have the following which does the one of the tasks i.e. adds a total row with the totals of each column. The last column is the total for each row so the last column in the footer is actually the total number</p>
  <pre><code>&quot;footerCallback&quot;: function (row, data, start, end, display) {
      var api = this.api(), data;
      var colNumber =Array.from(Array(45+1).keys()).slice(1);
             
      var intVal = function (i) {
          return typeof i === 'string' ? i * 1 : typeof i === 'number' ? i : 0;
      };
  
      for (i = 0; i &lt; colNumber.length; i++) {
          var colNo = colNumber[i];
          var total = api.column(colNo).data().reduce(function (a, b) {
              return intVal(a) + intVal(b);
          }, 0);
          $(api.column(colNo).footer()).html(total);
      }
  }
  </code></pre>
  <p>What I need in addition to the above is another row adding in the footer that shows a percentage for each column total</p>
  <p>I don't know where to start - any advice?</p>
  <p>Thanks</p>