jQuery Table Striping Example

Column 1 Column 2 Column 3
A B C
D E F
G H I
J K L

Code

        <script type="text/javascript" src="http://jqueryjs.googlecode.com/files/jquery-1.2.6.min.js"></script>
        
        <script type="text/javascript">
            $(function() {
                $('table tbody tr:odd').addClass('alt');
                
                $('table tbody tr').hover(function() {
                    $(this).addClass('hover');
                }, function() {
                    $(this).removeClass('hover');
                });
            });
        </script>
        
        <style type="text/css">
            body { font-family: Sans-Serif; }
            table { border: solid 1px #888; }
            table thead { background-color: #000; color: #fff; }
            table td, table th { padding: 6px; }
            .alt { background-color: #ddd; }
            .hover { background-color: #aaf !important; }
        </style>