CSS 在不影响内部数据表的情况下隐藏 <p:panelGrid> 素面的边框
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/21087484/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Hide border of <p:panelGrid> primefaces without affecting inner data table
提问by Shekhar Khairnar
How to hide the grid-line(border) of p:panelGrid without affecting the the border of inner data table in primefaces 4.0
如何在primefaces 4.0中隐藏p:panelGrid的网格线(边框)而不影响内部数据表的边框
Currently using this CSS :
目前使用这个 CSS :
.ui-panelgrid td, .ui-panelgrid tr{
border-style: none !important
}
which affects both data table and panel grid. But I want only panel grid lines to be hidden.
这会影响数据表和面板网格。但我只想隐藏面板网格线。
In my case data table is nested inside panel grid.
在我的情况下,数据表嵌套在面板网格内。
Thanks.
谢谢。
回答by Nikel Weis
I know I'm late to party but I just came accross the same problem and fixed it by using a h:panelgrid (standard jsf-library) instead of the primefaces element. There you have the border attribute.
我知道我迟到了,但我刚刚遇到了同样的问题,并通过使用 ah:panelgrid(标准 jsf-library)而不是 primefaces 元素来修复它。在那里你有边框属性。
<h:panelGrid border= "0">
[inner Table - not affected]
</h:panelGrid>
回答by user3839350
.ui-panelgrid tr, .ui-panelgrid td{
border:none !important;
}
.ui-datatable .ui-datatable-data tr,.ui-datatable .ui-datatable-data-empty tr,.ui-datatable .ui-datatable-data td,.ui-datatable .ui-datatable-data-empty td{
border:1px solid !important;
}
回答by K.Nicholas
As of version 5.3 (or earlier)
从 5.3 版(或更早版本)开始
Blank Mode:
To remove borders add ui-noborder
style class to the component using styleClass
attribute and to remove borders plus background color, apply ui-panelgrid-blank
style.
空白模式:要删除边框ui-noborder
使用styleClass
属性向组件添加样式类,并删除边框和背景色,请应用ui-panelgrid-blank
样式。
回答by Saeed
You can use this code in your CSS file:
您可以在 CSS 文件中使用此代码:
.ui-panelgrid > tr td, .ui-panelgrid > tr{
border-style: none !important
}