gyc gyc - 4 months ago 17
AngularJS Question

Selector for sortable header of ng-table

I'm using a sortable ng-table to display some data.
Each column has a sorting header. (which is a

<div>
inside a
<th class="sortable">
)

If I try to select the first header using

th.sortable > div:nth-child(1)


It selects all the divs inside each
<th>


I forked an existing fiddle and added a block at the top of the css pane.

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

Answer
th.sortable:nth-child(1) > div:nth-child(1) {
    background-color: red;
}

use it like this, if you want first selector for <th> can done like this also. : http://fiddle.jshell.net/bxhcu50a/

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