【发布时间】:2016-01-22 02:50:27
【问题描述】:
我正在使用 DataTables 库来构建表格。我使用 Bootstrap 来设置这些表格的样式。 DataTables 的功能之一是扩展详细信息/添加子行的 API。 (参见https://datatables.net/examples/api/row_details.html)它通过在当前行下插入一个新的 tr 来做到这一点。问题是这会干扰引导选择器应用行着色:
.table-striped > tbody > tr:nth-child(odd) > td,
.table-striped > tbody > tr:nth-child(odd) > th {
background-color: #f9f9f9;
}
选择器现在在奇数/偶数选择器中选择新的“详细信息”行。我不想要这个。
关于如何编写选择器以跳过这些详细信息行的任何想法?
例如未展开的
<tr role="row" class="odd">...</tr>
然后当我展开/显示详细信息时:
<tr role="row" class="odd shown">...</tr>
<tr>...</tr>
【问题讨论】:
标签: css twitter-bootstrap