Well, definitely the shorter version :) You can put a comment above to remind you that :even and :odd are tricky
// Remember, :even and :odd are zero-based, so it's reversed $('#foobar tbody tr:visible:even').addClass('rowodd'); $('#foobar tbody tr:visible:odd').addClass('roweven');