JSFiddle - React, Tailwind, and code Playground
HTML
<table class="table table-striped" id="res">
<tr>
<th>Category</th>
<th>Amount</th>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>a</td>
<td class="countable">
111
</td>
<td>aaa</td>
</tr>
<tr>
<td>b</td>
<td class="countable">
222
</td>
<td>bbb</td>
</tr>
</table>
JavaScript
var cls = document.getElementById("res").getElementsByTagName("td");
var sum = 0;
for (var i = 0; i < cls.length; i++){
if(cls[i].className == "countable"){
sum += isNaN(cls[i].innerHTML) ? 0 : parseInt(cls[i].innerHTML);
}
}
alert('sum is ' + sum);