title: SUM table column numbers NOT hidden - using .hide()
body: <p>As a novice programmer (with higher aspirations!), I have found this forum very educational.</p>
  
  <p>Sadly, I cannot simply join and add comments (min. of 50 credibility points).  Thus, I am forced to open a new question related to a previous post in order to slightly extend the proposed response:</p>
  
  <p><a href="https://stackoverflow.com/questions/9293492/sum-all-values-for-table-column-based-on-class/9293516#9293516">sum all values for table column based on class</a></p>
  
  <p>A great response.  However, I have searched around and cannot find a solution for adding column values (numbers), but only if the values are not hidden -  using .hide(). </p>
  
  <p>I have one button that hides it's table row when clicked.  In another table, I have another button that specifically shows that row when clicked.  in a similar approach to the referenced solution, I display a sum of the columns.  But, I will always get a total value, unless I can ignore the rows (containing the columns) that I have opted to hide.</p>
  
  <p>Any assistance is greatly appreciated.</p>
  
  <p>RELEVANT CODE:  CALCULATING SUM</p>
  
  <pre><code>&lt;script language="javascript" type="text/javascript"&gt;
  
  $(calculateSum);
  
  function calculateSum() {
  
  var sum = 0;
  
  // iterates through each td based on class "sumAMT" (perhaps here at the onset I could skip hidden rows?)
  
  $(".sumAMT").each(function() {
  
      var value = $(this).text();
  
  // adds only if the value is number  (this might also work as a place to determine if this is hidden value)
  
      if(!isNaN(value) &amp;&amp; value.length != 0) {
          sum += parseFloat(value);
      }
  });
  
  // Converts to standard comma delimited numeric presentation
  
  function Commas(x) {
      var parts = x.toString().split(".");
      parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ",");
      return parts.join(".");
  }
  
  // capture of results that are called by the DIV where I want the value displayed (  &lt;DIV id="result"&gt;&lt;/DIV&gt;  )
  
  $('#result').text('$'+Commas(sum));    
  };
  &lt;/script&gt;
  </code></pre>
  
  <p>RELEVANT CODE: REFERENCED TABLE ROW</p>
  
  <pre><code>&lt;tr id="row1" class="Row"&gt;
    &lt;td&gt;Some Text&lt;/td&gt;
    &lt;td width=20px class="sumAMT" id="R1"&gt;456.00&lt;/td&gt;
    &lt;td width=20px&gt;&lt;a href=""&gt;
      &lt;button id="row1Remove"&gt;remove&lt;/button&gt;
    &lt;/a&gt;&lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>