I’ve prepared a step by step demonstration to take someone else’s well written javascript and reduce it down to 5 lines or less. At the same time you’ll see how I make it a little more flexible and useful.

Take a look at “Stripe your tables the OO way” by Matthew Pennell. His code is clean and concise. And it’s an improvement over a past article from A List Apart.

But with the help of jQuery, I think we can do better.

The concept is to create stripes on a table and then have the background of each row change color when your cursor rolls over.

The Goal

As I mentioned, Mathew’s code is quite good. It shows a level of skill that most part-time web geeks might find difficult to attain. It’s certainly above the head of someone just starting to roll up their sleeves and learn javascript.

How can jQuery help?

My mission is to show you that jQuery can make this task

  • Easier to accomplish
  • Faster to load on the page
  • More flexible to use

So what are you waiting for? Jump into the tutorial and see how easy jQuery makes table striping.

[tags]jQuery, tutorial, javascript, DOM, table striping, zebra striping, AJAX[/tags]