Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Mar 2006
    Location
    Vienna, VA
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Vertical align the whole page.

    I have a table within the body tag and I need to valign the whole thing. I tried putting a valign="middle" in the body tag and the table tag, nothing worked. Anyone know how do do this?

    Matt

  • #2
    Senior Coder
    Join Date
    Dec 2004
    Location
    Essex, UK
    Posts
    2,636
    Thanks
    0
    Thanked 0 Times in 0 Posts

  • #3
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>Untitled Document</title>
    <style type="text/css">
    html, body {
    margin:0;
    padding:0;
    border:0;
    height:100%;
    }
    #main {
    width:100%;
    height:100%;
    }
    #maintd {
    vertical-align:middle;
    }
    </style>
    </head>
    
    <body>
    <table id="main" cellpadding="0" cellspacing="0">
    	<tr>
    	<td id="maintd">
    		<!--Your table code here-->
            </td>
    	</tr>
    </table>
    </body>
    </html>
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #4
    New to the CF scene
    Join Date
    Jun 2014
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by _Aerospace_Eng_ View Post
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>Untitled Document</title>
    <style type="text/css">
    html, body {
    margin:0;
    padding:0;
    border:0;
    height:100%;
    }
    #main {
    width:100%;
    height:100%;
    }
    #maintd {
    vertical-align:middle;
    }
    </style>
    </head>
    
    <body>
    <table id="main" cellpadding="0" cellspacing="0">
    	<tr>
    	<td id="maintd">
    		<!--Your table code here-->
            </td>
    	</tr>
    </table>
    </body>
    </html>
    I am using this code here: Door #3
    I would like the innermost table to force resize up to 70% of the web page height. How would I do this? Please post the EXACT code. Do not assume I know N E thing about N E syntax or 'callbacks' or other stuff. Post EVERYTHING needed 2 make it happen please =) The best way would be to just post my page 'source' but modified so the inner cell (the one with the purple background) forces the thing to expand so it fills 70% of the page height =D Please contact me at 'balkanguy at live dot com' when you answer or just send me the code please. Should B simple 4 a 'Supreme Master Coder God' type yes? Thanks!


  •  

    Posting Permissions

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