File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

h:panelGrid empty space in cells

 
Matej Mrakic
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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%;
}
Table.jpg
Output
[Thumbnail for Table.jpg]
 
Tim Holloway
Saloon Keeper
Pie
Posts: 17646
39
Android Eclipse IDE Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic