Bootstrap:tr class“warning”在条形表中不起作用 [英] Bootstrap: tr class "warning" doesn't work in striped-table
问题描述
我有一个表定义了< table class =table table-striped>
,其中一些行像< tr class =成功>
,< tr class =info>
和< tr class = 警告>
。
成功
和 info
table-rows显示正常:红色和蓝色就像它们应该是一样。但是警告
行不按预期显示黄色。 奇怪的是,如果我添加 table-hover
到表的类中时,警告
行将显示为黄色,但仅在悬停时显示。然而,成功
和信息
行总是显示其颜色,悬停或不显示。
!important
覆盖这个问题的一些特定的CSS: 。表格条纹> tbody> tr> .danger,
.table-striped> tbody> .danger> td,
.table-striped> tbody> .danger> th {
background-color:#f2dede!important;
显然为 thead
, tfoot
etc和 success
, info
等等if你使用这些。我只使用危险
,并且只在 tbody
中使用。我把这些修改放到了我的bootstrap.css文件中,这样当我升级到v3.1时,它会更新。
I've got a table defined <table class="table table-striped">
with some rows like <tr class="success">
, <tr class="info">
, and <tr class="warning">
.
The success
and info
table-rows show up fine: red and blue just as they should be. But the warning
rows don't show yellow as expected. They're just regular, zebra-stripe white or gray.
Weird thing is, if I add table-hover
to the table's classes, the warning
rows will show yellow, but only when hovered. The success
and info
rows, however, always show their colors, hover or no.
Regarding this issue with v3.0.3 (which will be fixed in v3.1, whenever they release it), a quick/rough fix for this is to add !important
overrides to some specific CSS for this issue:
.table-striped > tbody > tr > .danger,
.table-striped > tbody > .danger > td,
.table-striped > tbody > .danger > th {
background-color: #f2dede !important;
}
Obviously add this for thead
, tfoot
etc and success
, info
etc if you use those. I'm only using danger
, and only in the tbody
. I put these modifications in my bootstrap.css file, so that when I upgrade to v3.1 it will update anyway.
这篇关于Bootstrap:tr class“warning”在条形表中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!