How to Center Align ng-Table Header? How to Center Align ng-Table Header? angularjs angularjs

How to Center Align ng-Table Header?


The answer submitted by @OpenUserX03 is almost perfect, except you have to wrap the class name in single quotes, like so:

<td data-title="'Access ID'" sortable="'accessID'" style="width:120px" class="text-center" header-class="'text-center'">{{people.accessID}}</td>


You can use the header-class attribute to set the class for - you guessed it - the header.

<td data-title="'Access ID'" sortable="'accessID'" style="width:120px" class="text-center" header-class="text-center">{{people.accessID}}</td>


i used to have the same issue how to align left my ng-table headers.on the documentation of ng-table it does not say anything nor at the examples.

you have two ways to do this the fast and the more 'professional'

fast way:

open files ng-table/dist/ng-table.css and ng-table.min.css, according on which css file you use.on the first line it manages the header,

.ng-table th {  text-align: center;/*just change that parameter to left/right*/  -webkit-touch-callout: none;  -webkit-user-select: none;  -khtml-user-select: none;  -moz-user-select: none;  -ms-user-select: none;  user-select: none;}

'professional' way: create a custom style and add it to your website css file ,like this :

.table thead th {  text-align: left;/*change that parameter to left/right*/}

Hope helps, good luck.