This time I will share jQuery Plugin and tutorial about Table Data Calculation Plugin For jQuery – SumTableTotal, hope it will help you in programming stack.
SumTableTotal is a small jQuery plugin that adds a total row to your HTML table and displays the sum of columns you specify.
How to use it:
1. Put jQuery library and the ‘jquery.sumtabletotal.js’ script in the html page.
1 |
< script src = "//code.jquery.com/jquery.min.js" ></ script > |
2 |
< script src = "jquery.sumtabletotal.js" ></ script > |
2. Initialize the plugin and specify an array of table columns you want to calculate the total values.
1 |
$( "#table" ).sumtabletotal({ |
2 |
totalIndexArry: [3, 4, 5], |
3 |
rateObjectArry: [{numerator: 5, denominator: 4, index: 6}] |
3. Default plugin options, which can be overridden by passing in an object to the constructor with these properties
1 |
$( "#table" ).sumtabletotal({ |
This awesome jQuery plugin is developed by zealzhangz. For more Advanced Usages, please check the demo page or visit the official website.