Da in der Tat Bootstrap-Tabelle eine einfache HTML-Tabelle eingerichtet ist, können Sie die nächsten Ansatz mit Jquery
<table id="table1">
<tr class="titlerow">
<td>Column1</td>
<td>Column2</td>
<td>Column3</td>
</tr>
<tr>
<td class="col1">1</td>
<td class="col2">2</td>
<td class="col3">3</td>
</tr>
<tr>
<td class="col1">11</td>
<td class="col2">22</td>
<td class="col3">33</td>
</tr>
</table>
und
$(document).ready(function(){
var $dataRows=$("#table1 tr:not('.titlerow')");
var col1Total = 0;
$dataRows.each(function() {
var col1 = $(this).find('.col1');
col1Total += parseInt(col1.html());
});
});
col1Total ist eine Zahl, die Sie suchen, benutzen.
Und bei mehreren Tabellen nur
Selektor wie verwenden
var $dataRows=$("#table1 tr:not('.titlerow'), #table2 tr:not('.titlerow')");
der Wähler kann wahrscheinlich,
Teilen Sie Ihre HTML und Script optimiert werden –