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 3 of 3
  1. #1
    Regular Coder
    Join Date
    Jul 2002
    Location
    The Netherlands
    Posts
    252
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Problem with table-height in Netscape 4.x

    Hi,

    I've just finished my website and now I've discovered a problem that occurs when the site is viewed in Netscape 4.x Please take a look at the specific page (url: http://www.mileswebdesign.nl/site.php?x=5). As you can see two big black borders appear at the top and the bottom because the content is not long enough. When I view the page in IE it all looks fine. Does anyone know a 'cross-browser' solution??

    Thanx Michiel

  • #2
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,278
    Thanks
    4
    Thanked 83 Times in 82 Posts
    I couldn't even open your site in NS4.x. It kept redirecting to your style sheet.

    NS4.x doesn't particularly like having a table height set using percentages so here is a workaround:

    Code:
    <html>
    <head>
    <title>Full Height Table</title>
    </head>
    <body topmargin="0" leftmargin="0" marginwidth="0" marginheight="0">
    <script lanaguage="Javascript">
    <!--//
    var IE5up = document.getElementById&&document.all;
    var NS6up = document.getElementById&&!document.all;
    var NS4 = document.layers;
    var IE4 = document.all&&!window.print;
    if(NS4||NS6up)
    h=window.innerHeight;
    else
    h=document.body.clientHeight;
    
    //THIS IS THE START OF YOUR TABLE
    document.write('<table bgcolor="orange" border="1" width="100%" height="'+h+'">');
    
    document.close();
    //-->
    </script>
    <noscript>
    <!-- THIS IS FOR NONJAVASCRIPT ENABLED BROWSERS -->
    <table border="1" height="100%">
    </noscript>
    
    <tr><td>
    <h1>Some Text</h1>
    </td></tr>
    </table>
    </body>
    
    </html>
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster

  • #3
    Regular Coder
    Join Date
    Jul 2002
    Location
    The Netherlands
    Posts
    252
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for your solution, I'll go and add that to my page!

    Do you know why NS4.x redirected you to the stylesheet? I simply used this line:

    <link rel="stylesheet" type="text/css" href="style/NS1024x768.css">

    This is written by a javascript depending on the browser and screenresolution. Do you know a way to make this work after all?

    Thanx Michiel


  •  

    Posting Permissions

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