문제

I have a <p:panelGrid> as follows:

<p:panelGrid style="width: 50px">
    <p:row>
        <p:column colspan="2">
            <p:inputTextarea/>
        </p:column>
    </p:row>
</p:panelGrid>

I tried to set the width of the panel grid to 50px by setting the CSS width property, however it didn't become 50px wide.

How can I set the width of the panel grid to 50px?

도움이 되었습니까?

해결책

The <p:inputTextarea> is wider than the <p:panelGrid> and therefore pushing it far outside the specified width.

You need to set the width on the <p:inputTextarea> as well.

<p:inputTextarea style="width: 50px;" />

(note: this doesn't take margins into account, so the panel grid is still a bit larger than 50px, but you should now know how to finetune that)


Unrelated to the concrete problem, CSS should go in its own .css file.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top