So you want to write a Jquery plugin. If you know jQuery and Coffeescript, this would be amazingly easy. I will walk you through writing a jQuery plugin which will allow us to add alternating colors to alternating rows. Here is the plugin in its entirety. $ = jQuery $.fn.zebraTable = (options) -> defaults = evenColor: '#ccc' oddColor : '#eee' options = $.extend(defaults, options) @each -> $("tr:ev