简体   繁体   English

如何设置PrimeUI Datatable列宽

[英]How to set PrimeUI Datatable column width

How to set PrimeUI Datatable column width? 如何设置PrimeUI Datatable列宽? I have tried this code(" http://www.primefaces.org/primeui/datatable.html "), it is working fine but i want to set width of column, please help me 我试过这段代码(“ http://www.primefaces.org/primeui/datatable.html ”),它工作正常,但我想设置列的宽度,请帮帮我
Thx in advanced Thx在先进

Just add width to 只需添加宽度即可

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

class? 类?

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;
}

Another option is to use the headerStyle option in the columns array. 另一种选择是使用columns数组中的headerStyle选项。

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

I haven't been able to find the complete options list for the columns array so if anyone knows where it is please post it! 我无法找到列数组的完整选项列表,所以如果有人知道它在哪里,请发布它!

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

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