css - Bootstrap 危险类不适用于表行

标签 css ruby-on-rails twitter-bootstrap

我的 Rails 应用程序中有下表:

<table class='table table-bordered table-hover table-striped'>
    <thead>
      <tr>
        <th>ID</th>
        <th>Status</th>
      </tr>
    </thead>

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

并且带有“危险”类的行不会改变颜色。但是,如果我使用“成功”类,它会正确更改。

我正在使用 twitter-bootstrap-rails gem。

最佳答案

twitter-bootstrap gem 目前正在使用 bootstrap v 2.3.2

根据 Bootstrap version 2.3.2 Documentation For Tables以下是可用的行类:

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.

这就是为什么 .success 有效但 .danger 无效的原因。

我想您正在寻找 .error 类。

关于css - Bootstrap 危险类不适用于表行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23922055/

相关文章:

javascript - 使用带有 2 个滚动条的 Scrollspy

javascript - 从 CDN 加载的 Bootstrap Carousel 无法正常工作

css - 如何将没有输入的 Bootstrap 内联表单标签与有输入的标签对齐?

html - 如何用 img 标签覆盖 div(就像 background-image 一样)?

jquery - 为移动设备制作响应式导航

ruby-on-rails - Ruby on Rails 嵌套资源未定义的方法路径

ruby-on-rails - rails : save doesn't update record if called twice?

javascript - 这个架构在 Angular 1.2 及以上版本下是否仍然有效

javascript - 以透明方式在另一张新图像上显示一张新图像(CSS 或 JS)

javascript - 将我的数据库中可用的 pdf 上传到我的服务器