2017-02-12 17 views
0

私はPrimeNG dataTableを使用しています。私は、列の幅を変更したいと思います。私はstyleClass="id-width"を入れて、CSSファイルで、私は次のように置くid列でp-datatable - 列の幅の変更

<p-dataTable [value]="client" sortField="order"> 
    <p-column field="name" header="Name"> 
     <template let-col let-client="rowData" let-ri="rowIndex" pTemplate="body"> 
      <span>{{client[col.field]}}</span> 
     </template> 
    </p-column> 
    <p-column field="id" styleClass="id-width"> 
     <template let-col let-client="rowData" let-ri="rowIndex" pTemplate="body"> 
      <button pButton type="button" icon="fa fa-pencil" iconPos="left" (click)="edit(client[col.field])"></button> 
     </template> 
    </p-column> 
</p-dataTable> 

.id-width { 
    width: 49px; 
} 

しかし、下の画像によると、幅は変わりません。 2つの列は同じサイズのままです。

enter image description here

+0

PrimeNG = PrimeFaces! – Kukeltje

答えて

0

私は解決策を見つけた:の

<p-column field="id" styleClass="id-width">

へ: <p-column field="id" [style]="{'width':'49px'}">

関連する問題