twitter-bootstrap - 无法让 .table-striped 类工作

标签 twitter-bootstrap

我无法让我的 table-stripe 类与我的 Bootstrap 框架一起使用。

这是我的 table 的实时预览。我在我的 HTML 中设置了 .table-striped 类,但它没有显示在输出中。

我究竟做错了什么?

最佳答案

你的html是错误的。您有一个 tbody每行的标签,但 .table-striped 的 css依赖 tr:nth-child()以不同的方式设置行的样式:

.table-striped tbody > tr:nth-child(odd) > td,
.table-striped tbody > tr:nth-child(odd) > th

修复您的 html,以便您有一个 tbody 进行迭代。

另外,我在您的资源中看到了 bootstrap.css 和 bootstrap.min.css。一个就够了。

关于twitter-bootstrap - 无法让 .table-striped 类工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16759789/

相关文章:

css - Bootstrap : Force columns to stack up vertically on mobile (responsive design)

html - 在 bootstrap 4 的导航栏中悬停时不显示箭头

css - 重复的 Font Awesome 图标出现在 IE9 中

javascript - Bootstrap 轮播下一个和上一个功能不起作用,仅显示第一个图像

twitter-bootstrap - 修改 Bootstrap 中监视的 LESS 变量

javascript - iPad 上的 UI Bootstrap 复选框和 radio 速度较慢

html - 将 Bootstrap 网格应用于 RadioButtonList 的 ListItem

html - 修复了使用 Phonegap 和 Bootstrap 单击链接时 div 闪烁的问题

html - 居中动态div

html - 使用 Bootstrap ,添加位置绝对更改元素的宽度