Last active
May 28, 2018 22:30
-
-
Save jericrealubit/c012649062bebeecf35cb6deb8439b1c to your computer and use it in GitHub Desktop.
datatables alternate stripes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
///+ Service Type Stripe | |
var cnt = 0; | |
$('td:first-child').each(function() { | |
if ($(this).text() != '') { | |
cnt++; | |
if (cnt % 2 == 0) { | |
var oTR = $(this).parent(); | |
if (oTR.attr('class') == 'odd') { | |
var nx = oTR.css('background-color','#faf6e6'); | |
} else { | |
var ny = oTR.css('background-color','#fffae0'); | |
} | |
oTR.nextAll().each(function() { | |
if ($(this).find('td:eq(0)').text() == '' && cnt % 2 == 0) { | |
if ($(this).attr('class') == 'odd') { | |
$(this).css('background-color','#faf6e6'); | |
} else { | |
$(this).css('background-color','#fffae0'); | |
} | |
} else { | |
return false; | |
} | |
}); | |
} | |
} | |
}); | |
///- Service Type Stripe |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment