File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "h:panelGrid empty space in cells" Watch "h:panelGrid empty space in cells" New topic
Author

h:panelGrid empty space in cells

Matej Mrakic
Greenhorn

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

<ui:composition>
<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;"/>
</h:panelGrid>
</ui:composition>



.css

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: 16137
    
  21

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.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: h:panelGrid empty space in cells