gyc gyc - 6 months ago 37
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

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

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

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. :

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