title: skipping columns in table javascript
body: <p>Good day,</p>
  
  <p>I was trying to skip some columns on my table for it not to be stored into my variable but I cant make it to work.</p>
  
  <p>I just want to add a "skip" class on every "th" element  that I want to skip, then that column shouldn't be included on the loop.</p>
  
  <p>but I am stuck on iterating my array that my condition will be false on the next loop causing for it to be stored in my variable on the next loop.</p>
  
  <p>heres the js</p>
  
  <pre><code>var i = [];
  var value = [];
  
  $('.report-table tr').each(function(){     
  
   $('th', this).each(function(index){
              if($(this).hasClass('skip'))
              {
              console.log(index);
              i.push(index);
              }
              else
              {
                 value.push($(this).text());
              }
  
  
          }); 
  
   $('td', this).each(function(index){
              if(i.length!=0){ //this is where i am stuck right now
                  for(var t = i.length-1; t&gt;=0;t--){
                      if(i[t]==index)
                      {
                          console.log("skip :"+index);
                      }
                      else{
                           value.push($(this).text());
                      }
                  }
              }
              else{
                  value.push($(this).text());
              }
  
          }); 
  
  });
  </code></pre>
  
  <p>and the html</p>
  
  <pre><code>  &lt;table class="report-table table" id="dynamic-report"&gt;
  
                &lt;thead&gt;
                    &lt;th width="50%"&gt;Period Ending&lt;/th&gt;
                    &lt;th width="5%" class="rowValue"&gt;Jan 31, 2010&lt;/th&gt;
                    &lt;th width="5%" class="rowValue skip"&gt;Feb 31, 2011&lt;/th&gt;
                    &lt;th width="5%" class="rowValue"&gt;Mar 31, 2012&lt;/th&gt;
                    &lt;th width="5%" class="rowValue"&gt;Apr 31, 2010&lt;/th&gt;
                    &lt;th width="5%" class="rowValue skip"&gt;May 31, 2011&lt;/th&gt;
                    &lt;th width="5%" class="rowValue"&gt;Jun 31, 2012&lt;/th&gt;
                    &lt;th width="5%" class="rowValue"&gt;Jul 31, 2010&lt;/th&gt;
                    &lt;th width="5%" class="rowValue"&gt;Aug 31, 2011&lt;/th&gt;
                    &lt;th width="5%" class="rowValue"&gt;Sep 31, 2012&lt;/th&gt;
                &lt;/thead&gt;
                &lt;tbody&gt;
               &lt;tr class="indent-0 highLight bold"&gt;
                   &lt;td&gt;Asset&lt;/td&gt;
                   &lt;td class="emptyRow"&gt;&lt;/td&gt;
                   &lt;td class="rowValue"&gt;9,999,999.00&lt;/td&gt;
                   &lt;td class="rowValue"&gt;9,999,999.00&lt;/td&gt;
                   &lt;td class="rowValue"&gt;9,999,999.00&lt;/td&gt;
                   &lt;td class="rowValue"&gt;9,999,999.00&lt;/td&gt;
                   &lt;td class="rowValue"&gt;9,999,999.00&lt;/td&gt;
                   &lt;td class="rowValue"&gt;9,999,999.00&lt;/td&gt;
                   &lt;td class="rowValue"&gt;9,999,999.00&lt;/td&gt;
                   &lt;td class="rowValue"&gt;9,999,999.00&lt;/td&gt;
               &lt;/tr&gt;
               &lt;tr class="indent-1 bold "&gt;
                   &lt;td &gt;Current Assets&lt;/td&gt;
                   &lt;td class="emptyRow"&gt;&lt;/td&gt;
                   &lt;td class="rowValue"&gt;9,999,999.00&lt;/td&gt;
                   &lt;td class="rowValue"&gt;9,999,999.00&lt;/td&gt;
                   &lt;td class="rowValue"&gt;9,999,999.00&lt;/td&gt;
                   &lt;td class="rowValue"&gt;9,999,999.00&lt;/td&gt;
                   &lt;td class="rowValue"&gt;9,999,999.00&lt;/td&gt;
                   &lt;td class="rowValue"&gt;9,999,999.00&lt;/td&gt;
                   &lt;td class="rowValue"&gt;9,999,999.00&lt;/td&gt;
                   &lt;td class="rowValue"&gt;9,999,999.00&lt;/td&gt;
  
               &lt;/tr&gt;
               &lt;tr  class="indent-2"&gt;
                  &lt;td&gt;Bank Accounts&lt;/td&gt;
                  &lt;td class="emptyRow"&gt;&lt;/td&gt;
                  &lt;td class="rowValue"&gt;9,999,999.00&lt;/td&gt;
                   &lt;td class="rowValue"&gt;9,999,999.00&lt;/td&gt;
                   &lt;td class="rowValue"&gt;9,999,999.00&lt;/td&gt;
                   &lt;td class="rowValue"&gt;9,999,999.00&lt;/td&gt;
                   &lt;td class="rowValue"&gt;9,999,999.00&lt;/td&gt;
                   &lt;td class="rowValue"&gt;9,999,999.00&lt;/td&gt;
                   &lt;td class="rowValue"&gt;9,999,999.00&lt;/td&gt;
                   &lt;td class="rowValue"&gt;9,999,999.00&lt;/td&gt;
  
  
               &lt;/tr&gt;
      &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>