css - PrimeNg Datatable style a cell -
i'm using primeng datatable follows , need put specific css class each cell i'm able pass css class [class]="cssclassname" coming model class applied when control focused. there way apply class without need of focus control?
thanks in advance.
the example appears on documentation
<p-datatable [value]="cars" [editable]="true" resizablecolumns="true"> <p-column *ngfor="let col of cols, let c = index" [field]="col.field" [header]="col.text" [editable]="true" > <ng-template let-col let-car="rowdata" ptemplate="editor" let-r="rowindex"> <div [class]="cssclassname"> <input [(ngmodel)]="car[col.field]" appendto="body" [class]="cssclassname"> </div> </ng-template> </p-column> </p-datatable>
you can apply styleclass on reflect on cell.
<p-column [style]="{'text-align':'left'}" field="field name" header="header" [sortable]="true" styleclass="test">
Comments
Post a Comment