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つの列は同じサイズのままです。
PrimeNG = PrimeFaces! – Kukeltje