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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-30 01:36:56  来源:igfitidea点击:

Hide border of <p:panelGrid> primefaces without affecting inner data table

cssjsfprimefaces

提问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-noborderstyle class to the component using styleClassattribute and to remove borders plus background color, apply ui-panelgrid-blankstyle.

空白模式:要删除边框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
 }