Showing posts with label jquery Zebra Striped Table row. Show all posts
Showing posts with label jquery Zebra Striped Table row. Show all posts

Monday, 26 December 2011

jquery Zebra Striped Table row

Using jQuery its easy to create Zebra Stripes effect(alternating colored backgrounds) on table rows.
For this we need to define a css class and through jQuery we will apply style to each odd number table rows.

<style>.altRow{background-color: #f0f0f0; }</style>
jQuery:

<script type="text/javascript">
$(function() {
   $("table tr:odd").addClass("altRow");
});
</script>