• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

h:panelGrid empty space in cells

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
[Thumbnail for Table.jpg]
Output
 
Saloon Keeper
Posts: 27763
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
It's a pleasure to see superheros taking such an interest in science. And this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic