CSS row highlighting

CSS row highlighting

by infiniteloops

HTML

<table class='stripeMe'>
<tr>
    <td>Row 1</td>
</tr>
<tr>
    <td>Row 2</td>
</tr>
<tr>
    <td>Row 3</td>
</tr>
<tr>
    <td>Row 4</td>
</tr>
<tr>
    <td>Row 5</td>
</tr>
</table>

CSS

.stripeMe TR:hover{
    color: yellow;
}

.stripeMe TR{
    background-color: blue;
    color: white;    
}

.stripeMeAlt{
    background-color: Red !Important; 
}

.stripeMe TD{
    padding: 5px;
}

JavaScript

var rows = $('.stripeMe TR');
rows.each(function(ix){
    if((ix % 4) >= 2){
        $(this).addClass('stripeMeAlt');
    }
});