gpt4 book ai didi

angularjs - 在 Angular ui网格中设置列宽

转载 作者:行者123 更新时间:2023-12-04 03:10:53 25 4
gpt4 key购买 nike

我正在使用有 Angular 的ui-grid,并且有一个长约30列的长网格,我想为列设置固定宽度,以便至少可以轻松看到列标题。有没有一种方法可以设置所有列的宽度(例如10%),或者我必须一一设置每一列的宽度。

ui-grid

在ui-grid-header-cell上设置最小宽度后,许多列合并为一个

.ui-grid-header-cell {
min-width: 150px !important;
}

After setting min-width property

最佳答案

如果要查找固定宽度,则可以在columnDefs中使用width属性,如下所示:

columnDefs : [
{ field : 'pageIcon', displayName : 'Page Icon', width : 25},
{ field : 'pageName', displayName : 'Page Name', width : 100},
{ field : 'count', displayName : 'Count', width : '30%'}
]

关于angularjs - 在 Angular ui网格中设置列宽,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38049553/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com