繁体   English   中英

如何设置PrimeUI Datatable列宽

[英]How to set PrimeUI Datatable column width

如何设置PrimeUI Datatable列宽? 我试过这段代码(“ http://www.primefaces.org/primeui/datatable.html ”),它工作正常,但我想设置列的宽度,请帮帮我
Thx在先进

只需添加宽度即可

.pui-datatable thead th,.pui-datatable tbody td,.pui-datatable tfoot td

类?

Edit:

.pui-datatable thead th:nth-child(1),
.pui-datatable tbody td:nth-child(1),
.pui-datatable tfoot td:nth-child(1) {
    width: 50px;
}

.pui-datatable thead th:nth-child(2),
.pui-datatable tbody td:nth-child(2),
.pui-datatable tfoot td:nth-child(2) {
    width: 100px;
}

另一种选择是使用columns数组中的headerStyle选项。

{field:'view',headerText:'View',content:createEditButton, headerStyle :“width:8%”},

我无法找到列数组的完整选项列表,所以如果有人知道它在哪里,请发布它!

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM