I've got my table setup for Zebra striping, but how do I accomplish making the row color alternate for 2 rows instead of a single row?
My data markup looks like this:
<tr>
<td>@task.TaskNum</td>
<td>@task.RepiarTime</td>
<td>Priority Club</td>
<td>SD</td>
<td>Commercial</td>
<td>Reg Commercial</td>
<td>After Hours</td>
</tr>
<tr><td colspan="7">
@task.Description.ToString()
</td></tr>
I am using this to stripe it:
$(document).ready(function () {
$(".stripeMe tr").mouseover(function () { $(this).addClass("over"); }).mouseout(function () { $(this).removeClass("over"); });
$(".stripeMe tr:even").addClass("alt");
});
Something like this should work:
$(".stripeMe tr").each(function(i){
if (i%4 < 2){
$(this).addClass("alt");
}
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With