Snippets

“Zebra” effect on tables

When using tables, it is a good idea, for better readability, to give a different style to one line out of two. Using jQuery, this can be done easily, without any additional html markup.

$("tr:odd").addClass("odd");

Source: http://web.enavu.com/tutorials/top-10-jquery-snippets-includ...

Share this snippet

 
  • http://ycsmnews.com Rob Pachasa

    Will this work with BuddyPress by deafult?

    & I’m assuming you need the CSS with it?

  • http://rkkautsar.fav.cc/ rkkautsar

    Yeah, I think you need
    tr.odd{
    background:#999;
    color:#333;
    }

    or something like that