Jak usunąć obramowanie z określonych przestrzeni PrimeFaces p: panelGrid?
Mam problem z usunięciem obramowania z konkretnej PrimeFaces <p:panelGrid>
.
<p:panelGrid styleClass="companyHeaderGrid">
<p:row>
<p:column>
Some tags
</p:column>
<p:column>
Some tags
</p:column>
</p:row>
</p:panelGrid>
Udało mi się usunąć obramowanie z komórek za pomocą:
.companyHeaderGrid td {
border: none;
}
Ale
.companyHeaderGrid {
border: none;
}
Nie działa.
14 answers
Obramowanie jest ustawiane na wygenerowanych elementach tr
i td
, a nie na table
. To powinno wystarczyć:
.companyHeaderGrid.ui-panelgrid>*>tr,
.companyHeaderGrid.ui-panelgrid .ui-panelgrid-cell {
border: none;
}
Jak go znalazłem? Po prostu sprawdź wygenerowane wyjście HTML i wszystkie reguły stylu CSS w zestawie narzędzi Webdeveloper Chrome (rightclick, Inspect Element lub naciśnij F12). Firebug i IE9 mają podobny zestaw narzędzi. Jeśli chodzi o zamieszanie, pamiętaj, że JSF / Facelets ostatecznie generuje HTML i że CSS stosuje się tylko na znacznikach HTML, a nie na kodzie źródłowym JSF. Więc aby zastosować / finetune CSS musisz zajrzeć do strony klienta (webbrowser).
Zobacz też:
- Jak zastąpić domyślny CSS PrimeFaces niestandardowymi stylami?
- Usuń obramowanie ze wszystkich elementów PrimeFaces p: panelGrid
Jeśli nadal używasz PrimeFaces 4 lub starszych, użyj poniżej:
.companyHeaderGrid.ui-panelgrid>*>tr,
.companyHeaderGrid.ui-panelgrid>*>tr>td {
border: none;
}
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2017-05-23 12:34:20
Używam Primefaces 6.0 i aby usunąć obramowania z mojej siatki panelu używam klasy stylu "UI-noborder" w następujący sposób:
<p:panelGrid columns="3" styleClass="ui-noborder">
<!--panel grid contents -->
</p:panelGrid>
Używa pliku css o nazwie "components" w primefaces lib
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2017-01-11 07:58:18
To mi pomogło:
.ui-panelgrid td, .ui-panelgrid tr { border-style: none !important }
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2013-06-28 15:23:43
Jeśli odpowiedź BalusC nie działa spróbuj tego:
.companyHeaderGrid td {
border-style: hidden !important;
}
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2012-10-31 19:52:40
Jeśli znajdziesz linię między kolumnami, użyj poniższego kodu,
.panelNoBorder, .panelNoBorder tr, .panelNoBorder td{
border: hidden;
border-color: white;
}
Sprawdziłem to z Primefaces 5.1
<h:head>
<title>Login Page</title>
<h:outputStylesheet library="css" name="common.css"/>
</h:head>
<p:panelGrid id="loginPanel" columns="3" styleClass="panelNoBorder">
<p:outputLabel value="Username"/> <p:inputText id="loginTextUsername"/>
<p:outputLabel value="Password"/> <p:password id="loginPassword"/>
<p:commandButton id="loginButtonLogin" value="Login"/> <p:commandButton id="loginButtonClear" value="Clear"/>
</p:panelGrid>
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2014-10-26 17:11:18
/ Align = "Left" / x posiada atrybut w panelGrid o nazwie "columnClasses".
.no-border {
border-style: hidden !important ; /* or none */
} Tak więc, do panelGrid z 2 kolumnami, powtórz dwa razy klasę css.
<p:panelGrid columns="2" columnClasses="no-border, no-border">
Do innych elementów, brzydkie"!ważne " nie jest konieczne , ale do granicy tylko z nim działa dobrze do mnie.
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2015-01-30 22:09:36
Try
<p:panelGrid styleClass="ui-noborder">
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2016-03-21 05:58:59
Po prostu dodaj te linie na swoim niestandardowym css mycss.css
table tbody .ui-widget-content {
background: none repeat scroll 0 0 #FFFFFF;
border: 0 solid #FFFFFF;
color: #333333;
}
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2013-07-09 10:57:56
Jak wspomniano przez BalusC, ramka jest ustawiana przez PrimeFaces na wygenerowanych elementach tr
i td
, a nie na table
. Jednak podczas próby z PrimeFaces w wersji 5, wygląda na to, że istnieje bardziej specyficzne dopasowanie z CSS PrimeFaces .ui-panelgrid .ui-panelgrid-cell > solid
, które nadal powoduje wyświetlanie czarnych ramek podczas aplikacji sugerowanego stylu.
Spróbuj użyć następującego stylu, aby przesunąć przestrzeń podstawową bez użycia deklaracji !important
:
.companyHeaderGrid tr, .companyHeaderGrid td.ui-panelgrid-cell {
border: none;
}
Jako wzmianka upewnij się, że Twój CSS jest załadowany po pierwszej.
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2017-05-23 12:18:06
Jeśli chcesz czegoś prostszego, możesz po prostu zmienić:
<p:panelGrid >
</p:panelGrid>
Do:
<h:panelGrid border="0">
</h:panelGrid>
That ' s worked fine for me
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2016-05-09 16:57:42
Dla mnie działa tylko następujący kod
.noBorder tr {
border-width: 0 ;
}
.ui-panelgrid td{
border-width: 0
}
<p:panelGrid id="userFormFields" columns="2" styleClass="noBorder" >
</p:panelGrid>
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2016-08-26 16:41:52
Aby tradycyjne, jak również wszystkie nowoczesne motywy nie miały granicy, zastosuj następujące;
<!--No Border on PanelGrid-->
<h:outputStylesheet>
.ui-panelgrid, .ui-panelgrid td, .ui-panelgrid tr, .ui-panelgrid tbody tr td
{
border: none !important;
border-style: none !important;
border-width: 0px !important;
}
</h:outputStylesheet>
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2017-03-19 09:20:55
Proszę spróbować również
.ui-panelgrid tr, .ui-panelgrid td {
border:0 !important;
}
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2014-06-11 09:48:47
Użyj poniższej modyfikacji stylu, aby usunąć obramowanie przycisku radiowego Primefaces
.ui-selectoneradio td, .ui-selectoneradio tr
{
border-style: none !important
}
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2013-08-12 06:16:25