<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html>
<head>
<script type="text/javascript" src="/jquery/jquery-1.3.2.min.js"></script>
</head>
<body>
<table id="testTable">
<tr>
<th>Column A</th>
<th>Column B</th>
</tr>
<tr>
<td>1</td>
<td>5</td>
</tr>
<tr>
<td>1</td>
<td>5</td>
</tr>
</table>
<div id="result"></div>
<script type="text/javascript">
// $("td:nth-child(2)").append("<span> - 2nd!</span>");
// This stuff came from: http://naspinski.net/post/Use-jQuery-to-add-all-the-values-in-a-table-column_.aspx .
var total = 0;
var rows = $("#summaryTable tr:gt(0)");
rows.children("td:nth-child(2)").each(function() {
total += parseFloat($(this).html());
});
$("#result").html(total);
</script>
</body>
</html>
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE