• 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

height tag is not working correctly in 'body' element.

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

Please find below script in written in HTML

<html>
<form>
<body height="500px;" style="background-color: yellow;" >
<table width="100%" border="1" cellpadding="0" cellspacing="0" style="background-color: #FFFFFF; border: 2 solid #0000C0">
<tr>
<td> first </td>
<td> second </td>
</tr>
<tr>
<td> three </td>
<td> four </td>
</tr>
</table>
</body>
</form>
</html>

When I run this HTML code it is dislaying yellow background in form and table is showing on top. When I do same thing in JSF with following code

<f:view>
<h:form>

<body style="height:500px" leftmargin="0" rightmargin="0" topmargin="0" bottommargin="0">

<center>
<h:panelGrid width="100%" columns="2" border="0" columnClasses ="column1,column2" >
<center>

<h:outputText value="User Id:" />
<h:inputText id="userId" value="#{LoginValidation.loginname}" />


<h:outputText value=" " />
<h:commandButton value="Login" action="#{LoginValidation.CheckValidUser}" />

<h:outputText value="New User?" />
<h:commandLink value="Register Here" action="newuser" />

</center>
</h:panelGrid>
</center>
</body>
</h:form>
</f:view>

When I'm executing this script, it is not showing the hight which I mentioned in <body> tag, it is taking default height depending upon the values mentioned in <h:panelGrid>.

In case, if I give height in <h:panelGrid> then it is working fine.

Please help.

Thanks in advance.

Regards,
Sharath.
 
Saloon Keeper
Posts: 27762
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
You've got some seriously messed-up HTML/JSF there. You start with <html> but end with <f:view> and your form/f:form construct isn't any better. Also, the HTML body tag goes outside the form tags. In JSF, all the tags have to match up properly and be in their proper places. Actually, that's true in HTML as well, but web browsers are more likely not to complain about bad tags. Though they may display unreliably.

I'm not sure a body tag can have a height attribute, since the height of a web page body is whatever the user sizes the window to be.

When you set dimensions in web page components, they will tend to "stretch" their containing components, which appears to be what you're seeing.
[ July 30, 2007: Message edited by: Tim Holloway ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic