p-dataTable how to align content

UI Components for Angular
Post Reply
bfrascino
Posts: 11
Joined: 13 Mar 2012, 09:13

20 May 2017, 05:36

Hello all,

I have this:

Code: Select all

<p-dataTable [value]="patients" *ngIf="patients.length > 0">
  <p-column styleClass="col-button">
        <ng-template pTemplate="header">
            <button type="button" pButton icon="fa-refresh"></button>
        </ng-template>
        <ng-template let-car="rowData" pTemplate="body">
	   <button type="button" pButton icon="fa-edit" (click)="showDialogToAdd()"></button>
	   <button type="button" pButton icon="fa-trash-o" (click)="showDialogToAdd()"></button>
        </ng-template>
    </p-column>		
    <p-column field="firstName" header="Name"></p-column>
How can I align the content of the cells to the center?

suprriya
Posts: 37
Joined: 02 Nov 2016, 12:26

25 May 2017, 08:53

Use [style]="{'text-align':'center'}" in your p-column element.

P.S. If col-button is your own css calss then you can give text-align property there also.

Post Reply

Return to “PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 4 guests