Handsontable example
HTML
<div id="example1" class="hot handsontable htRowHeaders htColumnHeaders"></div>
CSS
</style><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/handsontable.full.min.js"></script><link type="text/css" rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/handsontable.full.min.css">
JavaScript
var example1 = document.getElementById('example1');
var hot = new Handsontable(example1, {
data: [
[2],
[2],
[2],
[2],
[2],
[2]
],
colHeaders: true,
rowHeaders: true,
trimRows: [1, 2, 3, 4, 5]
});
function countIt() {
var arr = hot.getSourceDataAtCol(0)
var sum = arr.reduce(add, 0);
function add(a, b) {
return a + b;
}
console.log(sum);
}
countIt()