jQuery: For each rows first cell
<p>I'm trying to add up the values of a column in a table using jQuery. To achieve this I am first trying to find the first cell of each row and then add them together and then place this value inside an input field.</p>

<p>What is the best of doing this?</p>

<p>So far I have:</p>

<pre><code>// for each row
$('table tbody tr').each(function () {

        $firstCell = $(this).index(1).find('input').val();

});
</code></pre>

<p>So I need to add together the first cells for each row. so essentially each instance of the $firstCell variable that is created. e.g.</p>

<pre><code>$('output').val(parseInt($firstCell.val()) + parseInt($firstCell.val()));
</code></pre>

<p>Can anyone point me in the right direction?</p>

<p>Thanks</p>
