0

我有这段代码,我想利用左边的空间(未归档的值)......

            [![<h:panelGrid columns="2" cellpadding="5" >
                <p:outputLabel value="Field1:" for="itField1" />
                <p:inputText id="itField1" style="width:200px" required="true"
                             value="#{bean.field1}">
                </p:inputText>
                <p:outputLabel value="Field2:" for="itField2" />
                <h:panelGrid columns="2" style="width:200px"  cellpadding="0" cellspacing="0" >
                    <p:inputText id="itField2" required="true" 
                         value="#{="#{bean.field2}"
                         />
                    <p:commandButton icon="fa fa-search"
                                     />
                </h:panelGrid>
                <p:outputLabel value="Field3:" for="itField3" />
                <p:inputText id="itField3" style="width:200px" required="true"
                             value="#{bean.field3}">
                </p:inputText>
            </h:panelGrid>]

我要这个! 在此处输入图像描述

但是,我明白了:( 在此处输入图像描述:

怎么做?

4

1 回答 1

0

这可以通过添加CSS样式width:100%来实现<p:inputText id="itField2" ..... /><p:commandButton .... />如下所示:

<p:inputText id="itField2" value="#{bean.field2}" required="true" style="width:100%"  />
<p:commandButton icon="fa fa-search" style="width:100%" />
于 2018-09-27T06:33:52.270 回答