Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Problem with 100% height table layout

Problem with 100% height table layout

Scheduled Pinned Locked Moved Web Development
helpquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    HaBiX
    wrote on last edited by
    #1

    Its a simple 3 cell table layout: top left cont In firefox it shows up just as i wanted, but when i open it in IE7 the table is actually bigger than window size and the vertical scroll bar apears. When i resize window it sometimes shows correct, but most of the time not. what am i doing wrong here?

    R 1 Reply Last reply
    0
    • H HaBiX

      Its a simple 3 cell table layout: top left cont In firefox it shows up just as i wanted, but when i open it in IE7 the table is actually bigger than window size and the vertical scroll bar apears. When i resize window it sometimes shows correct, but most of the time not. what am i doing wrong here?

      R Offline
      R Offline
      Rama Krishna Vavilala
      wrote on last edited by
      #2

      You are not doing anything wrong. The issue here is how the html element is interpreted by the brwosers. The two browsers implement it in different ways. So you cannot fix the issue without JavaScript. Here is a possible solution:

      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <html xmlns="http://www.w3.org/1999/xhtml">
      <head>

      <title>Test</title>
      <script type="text/javascript">
      <!--
      function resizeProperly() {
      if (window.innerHeight) {
      document.body.style.width =
      window.innerWidth + "px";
      document.body.style.height =
      window.innerHeight + "px";
      } else {
      document.body.style.width =
      document.documentElement.offsetWidth + "px";
      document.body.style.height =
      document.documentElement.offsetHeight + "px";
      }
      }

      window.onresize = window.onload = resizeProperly;
      //-->
      </script>
      </head>
      <body style="height: 100%;margin:0;padding:0">
      <table style="height:100%;width: 100%; border: 5px solid #000000;">
      <tr>
      <td colspan="2" style="width:100%">

      top</td></tr>
      <tr>
      <td style="width:100%">

      left</td>
      <td style="width:100%">
      cont</td></tr>
      </table>
      </body>
      </html>

      Co-Author ASP.NET AJAX in Action

      H 1 Reply Last reply
      0
      • R Rama Krishna Vavilala

        You are not doing anything wrong. The issue here is how the html element is interpreted by the brwosers. The two browsers implement it in different ways. So you cannot fix the issue without JavaScript. Here is a possible solution:

        <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
        <html xmlns="http://www.w3.org/1999/xhtml">
        <head>

        <title>Test</title>
        <script type="text/javascript">
        <!--
        function resizeProperly() {
        if (window.innerHeight) {
        document.body.style.width =
        window.innerWidth + "px";
        document.body.style.height =
        window.innerHeight + "px";
        } else {
        document.body.style.width =
        document.documentElement.offsetWidth + "px";
        document.body.style.height =
        document.documentElement.offsetHeight + "px";
        }
        }

        window.onresize = window.onload = resizeProperly;
        //-->
        </script>
        </head>
        <body style="height: 100%;margin:0;padding:0">
        <table style="height:100%;width: 100%; border: 5px solid #000000;">
        <tr>
        <td colspan="2" style="width:100%">

        top</td></tr>
        <tr>
        <td style="width:100%">

        left</td>
        <td style="width:100%">
        cont</td></tr>
        </table>
        </body>
        </html>

        Co-Author ASP.NET AJAX in Action

        H Offline
        H Offline
        HaBiX
        wrote on last edited by
        #3

        Seems part of my html code doesnt show inside code tags. Here's the link to page for what i was going for: http://212.18.51.202/layout.htm and problem i'm getting in IE: http://img143.imageshack.us/img143/1761/ssqh7.gif Thanks

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups