User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 375,222 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,198 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting

how to maximize table cell height

Join Date: Apr 2008
Posts: 6
Reputation: boyetp is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
boyetp boyetp is offline Offline
Newbie Poster

how to maximize table cell height

  #1  
Apr 21st, 2008
Hi there,

I'm new to this forum. I need help on how to maximize a table cell height.
First I have a table layout that has 3 rows, the first and third rows have fix 50px height.
I want to max the height of the of the 2nd row to fill the remaining space.

This works fine in firefox 2 but not in IE7. the height 100% in the ie 7 causes to overlap the body which cause to create a vertical scroll bar.

how should I do this. what would be the proper value for the 2nd row? I need help.

Also if you put a nested table in the 2nd row without row height define, the 100% height table won't stretch.

here's the code:

  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  5. <title>Untitled Document</title>
  6. </head>
  7. <style>
  8. html, body{
  9. height:96%;
  10. }
  11.  
  12. body{
  13. border: 1px solid red;
  14. }
  15. </style>
  16.  
  17. <body>
  18. <table border="1" cellspacing="5" cellpadding="5" style="height:100%; width:100%">
  19. <tr>
  20. <td style="width:100%;height:50px"> row 1 col 1</td>
  21. </tr>
  22. <tr>
  23. <td style="width:100%;height:100%"> row 2 col 1</td>
  24. </tr>
  25. <tr>
  26. <td style="width:100%;height:50px"> row 3 col 1</td>
  27. </tr>
  28. </table>
  29.  
  30. </body>
  31. </html>

regards,

boyetp
Last edited by peter_budo : Apr 24th, 2008 at 7:47 pm. Reason: Keep It Organized - please use [code] tags
AddThis Social Bookmark Button
Reply With Quote  
All times are GMT -4. The time now is 3:38 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC