background image

Content tagged with: first-child

Eric's picture

My design called for each table's first column to be a different style. I was going to use the "first-child" CSS selector, but of course, it does not work in IE6. Here's the jQuery I added to my theme to set the class name for the first td in each table tr. NOTE: As you can see, I only wanted to work on views tables.

<?php
$(document).ready(function(){
  $(
'div.view div.view-content table tr').each(function(i) {
    $(
'td:first', this).addClass('firstColumn');
  });
});
?>