Imr*_*ran 6 javascript css ag-grid angular ag-grid-angular
我正在尝试右对齐 AgGrid 中的列标题。我知道如何使用IHeaderAngularComp实现自定义标头组件并提供我自己的模板,但是对于一些应该微不足道的事情来说,这似乎需要大量工作。
https://stackblitz.com/edit/angular-ag-grid-angular-ebvgjb
我正在使用以下库。
“ag-grid-角度”:“21.2.1”
“ag-grid-community”:“21.2.1”
小智 10
如果您希望所有列标题右对齐:
defaultColDef: { headerClass: "ag-right-aligned-header"}
Run Code Online (Sandbox Code Playgroud)
如果您希望单个列标题右对齐:
{ headerName: "name", field: "field", headerClass: "ag-right-aligned-header" }
Run Code Online (Sandbox Code Playgroud)
You would need to make these 2 changes to the css file to make it happen... since there is a little burger menu which gets visible on hover also.
::ng-deep .ag-cell-label-container{flex-direction: row}
::ng-deep .ag-header-cell-label { flex-direction: row-reverse; }
Run Code Online (Sandbox Code Playgroud)
Forked your stackblitz with this change here
| 归档时间: |
|
| 查看次数: |
13047 次 |
| 最近记录: |