CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2009
    Posts
    1

    Increasing height of body div tag dynamically

    Hi
    I am java developer but i am strucked with css application. Actually i am using tiles concept in my application in which layout page using css tags to specify positions of header,menu ,body,footers.In this project my body content is getting dynamically from database when the content is more my body page is coming out of the footer pls help how to solve this problem my increasing the class "container" height dynamically this is my layout page.

    Code:
    <html>
    	<head>
    	<link href="./css/<&#37;=css%>.css" rel="stylesheet" type="text/css" /> 
    	</head>
    	<body>
    	<div class="container"> 
    	<table border="0" cellspacing="0" cellpadding="0" style="width:100%;height:100%">  
    	 
    	<tr>  
    	<td colspan="2" height="130">  
    	                    <tiles:insert attribute="header"/></td>   
    	</tr>  
    	<tr> 
    	<td width="190">  
    	                    <tiles:insert attribute="menu"/></td>  
    	<td width="710">   
    	                     <tiles:insert attribute="body"/></td> 
    	</tr>  
    	<tr>  
    	<td colspan="2" height="30"> 
    	                     <tiles:insert attribute="footer"/></td>  
    	</tr>  
    	
    	</table>  
    	
    	 </div>
    	
    	</body>  
    	</html>
    Last edited by PeejAvery; December 8th, 2009 at 11:12 AM. Reason: Added code tags.

  2. #2
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,284

    Re: Increasing height of body div tag dynamically

    Have you tried using the height and width properties for the div, ie :
    PHP Code:
    <div class="container" style="width:200 px;height:400 px"
    Just an ad hoc example.

  3. #3
    Join Date
    Jul 2005
    Location
    Currently in Mexico City
    Posts
    568

    Re: Increasing height of body div tag dynamically

    You can calculate body dimensions but you can't set them, or at least browsers will ignore these parameters. Do as HanneSThEGreaT suggested, create a wrapper div and set its height.
    Wanna install linux on a vacuum cleaner. Could anyone tell me which distro sucks better?

    I had a nightmare last night. I was dreaming that I’m 64-bit and my blanket is 32-bit and I couldn’t cover myself with it, so I’ve spent the whole night freezing. And in the morning I find that my blanket just had fallen off the bed. =S (from: bash.org.ru)

    //always looking for job opportunities in AU/NZ/US/CA/Europe :P
    willCodeForFood(Arrays.asList("Java","PHP","C++","bash","Assembler","XML","XHTML","CSS","JS","PL/SQL"));

    USE [code] TAGS! Read this FAQ if you are new here. If this post was helpful, please rate it!

  4. #4
    Join Date
    May 2009
    Posts
    160

    Re: Increasing height of body div tag dynamically

    Quote Originally Posted by vina789 View Post
    Hi
    I am java developer but i am strucked with css application. Actually i am using tiles concept in my application in which layout page using css tags to specify positions of header,menu ,body,footers.In this project my body content is getting dynamically from database when the content is more my body page is coming out of the footer pls help how to solve this problem my increasing the class "container" height dynamically this is my layout page.

    Code:
    <html>
    	<head>
    	<link href="./css/<%=css%>.css" rel="stylesheet" type="text/css" /> 
    	</head>
    	<body>
    	<div class="container"> 
    	<table border="0" cellspacing="0" cellpadding="0" style="width:100%;height:100%">  
    	 
    	<tr>  
    	<td colspan="2" height="130">  
    	                    <tiles:insert attribute="header"/></td>   
    	</tr>  
    	<tr> 
    	<td width="190">  
    	                    <tiles:insert attribute="menu"/></td>  
    	<td width="710">   
    	                     <tiles:insert attribute="body"/></td> 
    	</tr>  
    	<tr>  
    	<td colspan="2" height="30"> 
    	                     <tiles:insert attribute="footer"/></td>  
    	</tr>  
    	
    	</table>  
    	
    	 </div>
    	
    	</body>  
    	</html>
    what you could do is float your container div and inside that place your content div after the content div closes and before the closing of the container div, add a css class which has a style property of clear:both; this will solve your problem...
    cheers.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured