Bootstrap:tr class“warning”在条形表中不起作用 [英] Bootstrap: tr class "warning" doesn't work in striped-table

查看:560
本文介绍了Bootstrap:tr class“warning”在条形表中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个表定义了< table class =table table-striped> ,其中一些行像< tr class =成功> < tr class =info> < tr class = 警告>



成功 info table-rows显示正常:红色和蓝色就像它们应该是一样。但是警告行不按预期显示黄色。



奇怪的是,如果我添加 table-hover 到表的类中时,警告行将显示为黄色,但仅在悬停时显示。然而,成功信息行总是显示其颜色,悬停或不显示。

$ b $关于v3.0.3的这个问题(它将在v3.1中解决,无论何时释放它),一个快速/粗略的解决方案是添加!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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆