Skip to content

Instantly share code, notes, and snippets.

@anandkumar
Created August 14, 2013 11:55
Show Gist options
  • Save anandkumar/6230385 to your computer and use it in GitHub Desktop.
Save anandkumar/6230385 to your computer and use it in GitHub Desktop.
Color table using javascript.
<script type="text/javascript">jQuery(document).ready(function ($) {
$('table').css({
'border-collapse':'collapse'
});
$('tr th').css({'background':'#666666', 'color':'#ffffff', 'font-family':'verdana', 'font-weight':'normal'});
// Here using jquery selectors
$('tr:even').css({'background':'#f5f5f5'});
$('tr:odd').css({'background':'#e3e3e3'});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment