简体   繁体   English

如何使两个Primefaces面板彼此相邻?

[英]How to get two Primefaces panels next to each other?

Is there a way in primefaces to place two primefaces panel adjacent to each other ? Primeface中是否有办法将两个Primefaces面板彼此相邻放置? Panels are getting rendered only in vertical alignment. 仅以垂直对齐方式渲染面板。 Couldn't get them rendered in horizontal alignment , next to each other. 无法将它们彼此水平对齐地渲染。 Tried using h:panelGrid also. 也尝试使用h:panelGrid。 But no luck. 但是没有运气。

Here is the code fragment: 这是代码片段:

<h:panelGrid>
  <p:row>
  <p:column>
       <p:panel id="panel22" header="New Bill">
         <p:inputText>aaa</p:inputText>
       </p:panel>
  </p:column>
  <p:column>
    <p:panel id="panel222" header="Chart">
        <p:inputText>bbb</p:inputText>
      </p:panel>
  </p:column>
 </p:row>
</h:panelGrid>   

Try below code. 尝试下面的代码。 This would show both panels side by side with same height. 这将显示两个面板并排且高度相同。

<h:panelGrid columns="2">
       <p:panel id="panel22" header="New Bill" style="height:200px">
         <p:inputText>aaa</p:inputText>
       </p:panel>
    <p:panel id="panel222" header="Chart" style="height:200px">
        <p:inputText>bbb</p:inputText>
      </p:panel>
</h:panelGrid>

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

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