angularjs – 如何居中对齐表头?
发布时间:2020-12-17 09:52:26 所属栏目:安全 来源:网络整理
导读:全部, 我正在为网格使用ng-table.我正在使用以下代码段来设置列. td data-title="'Access ID'" sortable="'accessID'" style="width:120px" class="text-center"{{people.accessID}}/td 但我无法将列标题居中对齐,而是列数据. 以下是Access ID标头的源代码段
全部,
我正在为网格使用ng-table.我正在使用以下代码段来设置列. <td data-title="'Access ID'" sortable="'accessID'" style="width:120px" class="text-center">{{people.accessID}}</td> 但我无法将列标题居中对齐,而是列数据. 以下是Access ID标头的源代码段. <th ng-repeat="column in $columns" ng-class="{ 'sortable': parse(column.sortable),'sort-asc': params.sorting()[parse(column.sortable)]=='asc','sort-desc': params.sorting()[parse(column.sortable)]=='desc' }" ng-click="sortBy(column,$event)" ng-show="column.show(this)" ng-init="template=column.headerTemplateURL(this)" class="header sortable"> <!-- ngIf: !template --><div ng-if="!template" ng-show="!template" ng-bind="parse(column.title)" class="ng-binding ng-scope">Access ID</div><!-- end ngIf: !template --> <!-- ngIf: template --> </th> 问题是,如何将ng-table中特定列的Header居中对齐?
@ OpenUserX03提交的答案几乎是完美的,除非您必须将类名称用单引号括起来,如下所示:
<td data-title="'Access ID'" sortable="'accessID'" style="width:120px" class="text-center" header-class="'text-center'">{{people.accessID}}</td> (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |