title: Table row and col highlight with zebra striping
body: <p>I have taken the Chris Coyier table row and col highlight code and added zebra striping. I can get the row to highlight but the col stops highlighting when zebra stripes are enabled.</p>
  
  <p>If you uncomment the 1st 2 lines of jQuery to show zebra striping you will see the problem I've outlined above.</p>
  
  <p>Not entirely sure why these are conflicting.</p>
  
  <p>Any help appreciated.</p>
  
  <p>Sorry about ALL the code being here but it seems I can't use jsFiddle to show you, ya know, that really helpful service to show you code working so you can edit and fiddle with it.</p>
  
  <p><strong>CSS</strong></p>
  
  <pre><code>table           {width:100%; border-collapse:collapse;}
  
      th          {background:#95bce2; color:white; font-weight:bold;}
      td, th      {padding:6px; border:1px solid #95bce2; text-align:left;}
  
  .even           {background-color:#ecf6fc;}
  .odd            {background-color:white;}
  
  .hover          {background-color:#ccc!important;}
  .focus          {background-color:#6ab9d0!important; color:white;}​
  </code></pre>
  
  <p><strong>JQuery</strong></p>
  
  <pre><code>/* If I uncomment these lines the colgroup highlight doesn't work */ 
  //$('tr:odd').addClass('odd')
  //$('tr:even').addClass('even')
  
  
  $('.table1').delegate('td','mouseover mouseleave', function(e)
  {
      if (e.type == 'mouseover')
      {            
          $(this).addClass('focus');
          $(this).parent().addClass('hover');
          $("colgroup").eq($(this).index()).addClass('hover');
      }
      else
      {
          $(this).removeClass('focus');
          $(this).parent().removeClass('hover');
          $('colgroup').eq($(this).index()).removeClass('hover');
      }
  });
  </code></pre>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;table class="table1"&gt;
          &lt;colgroup&gt;&lt;/colgroup&gt;
          &lt;colgroup&gt;&lt;/colgroup&gt;
          &lt;colgroup&gt;&lt;/colgroup&gt;
          &lt;colgroup&gt;&lt;/colgroup&gt;
          &lt;colgroup&gt;&lt;/colgroup&gt;
          &lt;colgroup&gt;&lt;/colgroup&gt;
          &lt;colgroup&gt;&lt;/colgroup&gt;
          &lt;colgroup&gt;&lt;/colgroup&gt;
          &lt;colgroup&gt;&lt;/colgroup&gt;
          &lt;colgroup&gt;&lt;/colgroup&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;First Name&lt;/th&gt;
              &lt;th&gt;Last Name&lt;/th&gt;
              &lt;th&gt;Job Title&lt;/th&gt;
              &lt;th&gt;Favorite Color&lt;/th&gt;
              &lt;th&gt;Wars or Trek?&lt;/th&gt;
              &lt;th&gt;Porn Name&lt;/th&gt;
              &lt;th&gt;Date of Birth&lt;/th&gt;
              &lt;th&gt;Dream Vacation City&lt;/th&gt;
              &lt;th&gt;GPA&lt;/th&gt;
              &lt;th&gt;Arbitrary Data&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;James&lt;/td&gt;
              &lt;td&gt;Matman&lt;/td&gt;
              &lt;td&gt;Chief Sandwich Eater&lt;/td&gt;
              &lt;td&gt;Lettuce Green&lt;/td&gt;
              &lt;td&gt;Trek&lt;/td&gt;
              &lt;td&gt;Digby Green&lt;/td&gt;
              &lt;td&gt;January 13, 1979&lt;/td&gt;
              &lt;td&gt;Gotham City&lt;/td&gt;
              &lt;td&gt;3.1&lt;/td&gt;
              &lt;td&gt;RBX-12&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
            &lt;td&gt;The&lt;/td&gt;
            &lt;td&gt;Tick&lt;/td&gt;
            &lt;td&gt;Crimefighter Sorta&lt;/td&gt;
            &lt;td&gt;Blue&lt;/td&gt;
            &lt;td&gt;Wars&lt;/td&gt;
            &lt;td&gt;John Smith&lt;/td&gt;
            &lt;td&gt;July 19, 1968&lt;/td&gt;
            &lt;td&gt;Athens&lt;/td&gt;
            &lt;td&gt;N/A&lt;/td&gt;
            &lt;td&gt;Edlund, Ben (July 1996).&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
            &lt;td&gt;Jokey&lt;/td&gt;
            &lt;td&gt;Smurf&lt;/td&gt;
            &lt;td&gt;Giving Exploding Presents&lt;/td&gt;
            &lt;td&gt;Smurflow&lt;/td&gt;
            &lt;td&gt;Smurf&lt;/td&gt;
            &lt;td&gt;Smurflane Smurfmutt&lt;/td&gt;
            &lt;td&gt;Smurfuary Smurfteenth, 1945&lt;/td&gt;
            &lt;td&gt;New Smurf City&lt;/td&gt;
            &lt;td&gt;4.Smurf&lt;/td&gt;
            &lt;td&gt;One&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
            &lt;td&gt;Cindy&lt;/td&gt;
            &lt;td&gt;Beyler&lt;/td&gt;
            &lt;td&gt;Sales Representative&lt;/td&gt;
            &lt;td&gt;Red&lt;/td&gt;
            &lt;td&gt;Wars&lt;/td&gt;
            &lt;td&gt;Lori Quivey&lt;/td&gt;
            &lt;td&gt;July 5, 1956&lt;/td&gt;
            &lt;td&gt;Paris&lt;/td&gt;
            &lt;td&gt;3.4&lt;/td&gt;
            &lt;td&gt;3451&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
            &lt;td&gt;Captain&lt;/td&gt;
            &lt;td&gt;Cool&lt;/td&gt;
            &lt;td&gt;Tree Crusher&lt;/td&gt;
            &lt;td&gt;Blue&lt;/td&gt;
            &lt;td&gt;Wars&lt;/td&gt;
            &lt;td&gt;Steve 42nd&lt;/td&gt;
            &lt;td&gt;December 13, 1982&lt;/td&gt;
            &lt;td&gt;Las Vegas&lt;/td&gt;
            &lt;td&gt;1.9&lt;/td&gt;
            &lt;td&gt;Under the couch&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
  &lt;/table&gt;​
  </code></pre>