title: jquery to hide column based on td value
body: <p>I have a page where I am dynamically trying to hide columns in tables of class exception_table based on the value in the <code>td</code> of class <code>tdHideShow</code>. </p>
  
  <p>If the value is not equal to a value the user has selected <code>strDMM</code>, from a dropdown I want to hide the <code>td</code>, thus hiding that column of my table. Something in the syntax of my else is not working correctly, the <code>td</code> is not being hidden.</p>
  
  <pre><code>$('.exception_table',this).each(function(ind,obj){
  
                  if(!($('tr td.tdHideShow',this).hasClass(strDMM))){
                      $(this).hide();
                  }
                  else{
                      count++;
                  }
  
                  $('tr td.tdHideShow',this).each(function(ind,obj){
                          if(!($(this).hasClass(strDMM))){
                              //trying to hide the column if it is missing the class I am looking for
                          }
                  });
  
              });
  
              if(count==0){
                  $(this).parent.hide();
              }
  
          });  
  </code></pre>
  
  <p>Here is my sample html. I want any table that does not have class Bob, and hide columns that are not Bob. I am hiding the divs that don't have Bob in any table, hiding the tables that don't have Bob at all. I need to hide the table column in the first div, first table, that contains Billy. The html is dynamic and changes, the user filters on DMM name.</p>
  
  <pre><code>&lt;div class="East"&gt;
      &lt;table class="exception_table"&gt;
          &lt;tr&gt;
              &lt;td&gt;DMM NAME&lt;/td&gt;
              &lt;td class="tdHideShow Bob"&gt;Bob&lt;/td&gt;
              &lt;td class="tdHideShow Bob"&gt;Bob&lt;/td&gt;
              &lt;td class= "tdHideShow Billy"&gt;Billy&lt;/td&gt;
  
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Sales&lt;/td&gt;
              &lt;td&gt;$1&lt;/td&gt;
              &lt;td&gt;$5&lt;/td&gt;
              &lt;td&gt;$10&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Tenure&lt;/td&gt;
              &lt;td&gt;2 years&lt;/td&gt;
              &lt;td&gt;2 years&lt;/td&gt;
              &lt;td&gt;1 year&lt;/td&gt;
          &lt;/tr&gt;
  
  
      &lt;/table&gt;
      &lt;table class="exception_table"&gt;
          &lt;tr&gt;
              &lt;td&gt;DMM NAME&lt;/td&gt;
              &lt;td class="tdHideShow Paul"&gt;Pal&lt;/td&gt;
              &lt;td class="tdHideShow Doug"&gt;Doug&lt;/td&gt;
              &lt;td class= "tdHideShow Joe"&gt;Joe&lt;/td&gt;
  
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Sales&lt;/td&gt;
              &lt;td&gt;$5&lt;/td&gt;
              &lt;td&gt;$6&lt;/td&gt;
              &lt;td&gt;$70&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Tenure&lt;/td&gt;
              &lt;td&gt;7 years&lt;/td&gt;
              &lt;td&gt;9 years&lt;/td&gt;
              &lt;td&gt;2 years &lt;/td&gt;
          &lt;/tr&gt;
  
  
      &lt;/table&gt;
          &lt;table class="exception_table"&gt;
                  &lt;tr&gt;
                      &lt;td&gt;DMM NAME&lt;/td&gt;
                      &lt;td class="tdHideShow Tim"&gt;Tim&lt;/td&gt;
                      &lt;td class="tdHideShow Tim"&gt;Tim&lt;/td&gt;
                      &lt;td class= "tdHideShow Tim"&gt;Tim&lt;/td&gt;
  
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;td&gt;Sales&lt;/td&gt;
                      &lt;td&gt;$1&lt;/td&gt;
                      &lt;td&gt;$5&lt;/td&gt;
                      &lt;td&gt;$10&lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;td&gt;Tenure&lt;/td&gt;
                      &lt;td&gt;1 years&lt;/td&gt;
                      &lt;td&gt;1 years&lt;/td&gt;
                      &lt;td&gt;1 years&lt;/td&gt;
                  &lt;/tr&gt;
  
  
      &lt;/table&gt;
  
  &lt;/div&gt;
  
  &lt;/html&gt;
  </code></pre>