Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

Simple jQuery table striping

View jquery-stripeRows.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
/*
* jQuery Table Striping - v0.1 - 05/12/2011
* http://corydorning.com, http://justinrains.com
*
* Dual licensed under 'Use it like you stole it'
* and 'We Don't Care'
*
* Description: Stripe table rows easily by calling 'stripeRows'
* on any collection of <tr> elements and passing in the desired
* colors.
*
* Example usage:
* $('tr').stripeRows('#eee', '#ccc');
*
*/
 
$.fn.stripeRows = function(e,o) {
return this
.filter(':even')
.css('background-color', e)
.end()
.filter(':odd')
.css('background-color', o);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.