Hommer Smith Hommer Smith - 3 months ago 40x
CSS Question

Bootstrap danger class not working for a table row

I have the following table in my Rails app:

<table class='table table-bordered table-hover table-striped'>

<tr class='danger'>
<td><%= order.id %></td>
<td><%= order.status.name %></td>

And the row with class 'danger' doesn't change the color. However, if I use the class 'success' it changes correctly.

I am using the twitter-bootstrap-rails gem.


twitter-bootstrap gem is currently using bootstrap v 2.3.2.

And as per the Bootstrap version 2.3.2 Documentation For Tables following are the available row classes:

Optional row classes

Use contextual classes to color table rows.

.success    Indicates a successful or positive action.
.error      Indicates a dangerous or potentially negative action.
.warning    Indicates a warning that might need attention.
.info       Used as an alternative to the default styles.

Which is why .success worked but NOT .danger.

I suppose you are looking for .error class.