Can A Table Be Used This Way?


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 5 of 5

Thread: Can A Table Be Used This Way?

  1. #1
    Join Date
    Dec 2003
    Posts
    83

    Can A Table Be Used This Way?

    I need something that seems quite simple but has given me a rediculously hard time.

    Can a table with three rows be used to fill the screen vertically with a fixed top and bottom row height but a flexible center row that stretches as needed depending on the browser window?

    Here is the code that isn't working for me at all. The table height fills the window perfectly but when the browser window is resized the table rows stretch weirdly even though the top and bottom ones have set heights. I only want the center row to resize. The text is there just as content because without it I can't even see the table.

    What am I doing wrong?

    Code:
    <html style="height: 100&#37;;">
    <head>
        <title></title>
        <meta http-equiv="X-UA-Compatible" content="IE=7">
    </head>
    <body style="height: 100%; text-align: center;" bottommargin="0" leftmargin="0" rightmargin="0" topmargin="0">
            <table style="width: 1016px; height: 100%" border="2">
                <tr>
                    <td style="width: 8px;"></td>
                    <td style="height: 65px;">text</td>
                    <td style="width: 8px;"></td>
                </tr>
                <tr>
                    <td style="width: 8px"></td>
                    <td>text</td>
                    <td style="width: 8px"></td>
                </tr>
                <tr>
                    <td style="width: 8px;"></td>
                    <td style="height: 20px">text</td>
                    <td style="width: 8px;"></td>
                </tr>
            </table>
    </body>
    </html>

  2. #2
    Join Date
    Dec 2003
    Posts
    83
    Ok, I figured out the problem but I'm still baffled.
    When I remove the line
    Code:
    <meta http-equiv="X-UA-Compatible" content="IE=7">
    it works exactly as I need it to. The problem now is I can't set a DOCTYPE without it going completely crazy again.

    I'm tempted not to use a DOCTYPE at all since that seems to be the only way I can get it to work correctly but I've read that is a bad idea and some newer browsers can't display pages correctly without it.

    Any advice?

  3. #3
    Join Date
    Dec 2003
    Posts
    83
    Got it!

    http://themaingate.net/dev/html/all-...s-doctype-html got me sorted out.

    Seems all I needed was the <!doctype html> declaration to get into Standards mode and then surround the entire code above in another table that takes up 100% of the height and width of the browser window.

  4. #4
    Join Date
    Dec 2003
    Posts
    83
    Am I what?

  5. #5
    Join Date
    Dec 2003
    Posts
    83
    Oh nevermind. I just checked my email and saw your original response which made no sense at all (and was more than a little offensive). It's gone now so I assume the mods are busy cleaning up behind you. Have a nice day

Similar Threads

  1. Database Design Help needed
    By Brian Pittman in forum Database
    Replies: 2
    Last Post: 04-29-2007, 09:23 AM
  2. Attn: Daniel Reber
    By joe in forum Database
    Replies: 0
    Last Post: 04-04-2003, 06:25 PM
  3. Re: (No subject)
    By Joe in forum Database
    Replies: 0
    Last Post: 04-04-2003, 06:13 PM
  4. Multi-row calculations
    By Bob Hines in forum Database
    Replies: 7
    Last Post: 04-27-2000, 12:14 PM
  5. Replies: 2
    Last Post: 04-13-2000, 02:53 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center