Skip to content

Instantly share code, notes, and snippets.

@danromero
Created January 28, 2014 22:30
Show Gist options
  • Save danromero/8677927 to your computer and use it in GitHub Desktop.
Save danromero/8677927 to your computer and use it in GitHub Desktop.
Highlight HTML table cells based on class and value (uses Bootstrap 3 tr/td class stylings)
$("td.days").each(function() {
$this = $(this)
var value = $this.html();
if (value<2) { $this.addClass('success');}
else if (value<5) { $this.addClass('warning');}
else { $this.addClass('danger');}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment