Table Zebra Striping with jQuery

Tired of all those even/odd classes on your table striping? Bummed out with the lack of CSS3 support in Internet Explorer 6, 7 & 8? Then why not try some jQuery?

Came across a lovely article today entitled Zebra Striping Made Easy which makes zebra-striping… well… easy.

And in only five lines of code:

<script type="text/javascript">
    //<![CDATA[
    $(document).ready(function(){
        $("table tr").mouseover(function(){$(this).addClass("over");}).mouseout(function(){$(this).removeClass("over");});
    $("table tr:even").addClass("alt");
    });
    //]]>
</script>

Lovely.

Book a FREE Consultation Today

Pick a day & time in the calendar that suits you for a 30 minute phone, video or in-person* meeting to run through your needs and explore options.

Please include a brief summary of your request along with any existing links, etc.

* In-person visits available in the Isle of Purbeck, Dorset and surrounding areas only