File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSF and the fly likes h:panelGrid empty space in cells Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "h:panelGrid empty space in cells" Watch "h:panelGrid empty space in cells" New topic

h:panelGrid empty space in cells

Matej Mrakic

Joined: Nov 23, 2011
Posts: 1
Can somebody please explain why I get empty space in cells?

<h:panelGrid columns="2" border="1" width="100%" cellpadding="0" cellspacing="0">
<h:outputText value="Message" style="width: 100%"></h:outputText>
<h:inputTextarea rows="2"/>
<h:outputText value="URL" style="width: 100%;" ></h:outputText>
<h:inputText style="width: 100%;" />
<h:panelGroup > </h:panelGroup>
<h:commandButton value="Send" style="background-color:#1056c6;color: white;font-weight: bold;"/>


textarea {
resize: none;
text-align: left;
margin-bottom: 10px;
margin-left: 0;
margin-right: 0;
width: 100%;

[Thumbnail for Table.jpg]

Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17410

Welcome to the JavaRanch, Matej!

The width CSS style attribute doesn't work on outputText, since outputText renders with the style attached to a span element, and width doesn't work with span. You'll do better using the columnClasses attribute on the panelGrid itself.

As yo why the spacing, I can only venture a guess that given so much free space to play with, the table renderer decided that that was a good column width in the absence of anything more explicit.

An IDE is no substitute for an Intelligent Developer.
I agree. Here's the link:
subject: h:panelGrid empty space in cells
It's not a secret anymore!