ng-table的可排序标题的选择器

时间:2016-07-28 11:35:32

标签: css angularjs ngtable

我使用可排序的ng表来显示一些数据。 每列都有一个排序标题。 (<div>内的<th class="sortable">

如果我尝试使用

选择第一个标题
th.sortable > div:nth-child(1)

它选择每个<th>

中的所有div

我分叉了一个现有的小提琴,并在css窗格的顶部添加了一个块。

http://fiddle.jshell.net/7mom2ar0/

1 个答案:

答案 0 :(得分:1)

th.sortable:nth-child(1) > div:nth-child(1) {
    background-color: red;
}
如果你想要<th>的第一个选择器,

像这样使用它 也可以这样做。 :http://fiddle.jshell.net/bxhcu50a/

th.sortable:first-child > div:first-child {
    background-color: red;
}