Skip to content

Instantly share code, notes, and snippets.

@recursive
Created February 9, 2011 07:26
Show Gist options
  • Select an option

  • Save recursive/818103 to your computer and use it in GitHub Desktop.

Select an option

Save recursive/818103 to your computer and use it in GitHub Desktop.
jquery odd row example
<!DOCTYPE html>
<html>
<head>
<style>
table {background:#ccc; color: white;}
.odd {background:#777;}
</style>
<script src="http://code.jquery.com/jquery-1.5.min.js"></script>
</head>
<body>
<table>
<tr><td>Odd Row</td></tr>
<tr><td>Even Row</td></tr>
<tr><td>Another Odd</td></tr>
<tr><td>Another Even</td></tr>
</table>
<script>jQuery("tr:odd").addClass('odd');</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment