Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 14
  1. #1
    Junior Member
    Join Date
    Oct 2003
    Posts
    4
    Member #
    3572
    this always pisses me off. i want to make a table that takes up the whole screen.

    width=100%, obviously works fine.
    height=100% only works in IE. I need to be able to do this in netscape too.

    does anyone have a fix, so that it will work in both IE and NN.

    javascript, css, anything, i dont care!!!!!

  2.  

  3. #2
    Senior Member Delerium's Avatar
    Join Date
    Jan 2003
    Location
    Toronto, Ontario, Canada
    Posts
    193
    Member #
    462
    That tag is kinda buggy - it was discussed over here too: http://www.webdesignforums.net/thread9237.html

  4. #3
    Junior Member romenov's Avatar
    Join Date
    Oct 2003
    Location
    Belgium
    Posts
    29
    Member #
    3470
    Try placing the height in your td instead of your table ..
    Height and Width in tables are tipical frontpage codes

  5. #4
    JR
    JR is offline
    Senior Member JR's Avatar
    Join Date
    Nov 2002
    Location
    UK
    Posts
    4,354
    Member #
    257
    I think W3C says you have to use CSS:
    Code:
    .table {
    height: 100%;
    }
    JR

  6. #5
    Junior Member
    Join Date
    Oct 2003
    Location
    New York
    Posts
    13
    Member #
    3580
    For some god forsaken reason the W3C did not want table height to be a valid option. There are a few ways to get around this. It will not make any difference whether this is done in HTML or CSS (at least not on the browsers I tried it on).

    Option 1:. This works only when you know the exact height
    If you are able to use this option, then go for it. First create a 1x1 pixel image, that is either transparent, or the same color as your background. Then instead of making the table height="400", do it to the image like so:

    Code:
    <table border="1">
      <tr>
        <td width="1">
            <img src="spacer.gif" width="1" height="400" />
        </td>
        <td valign="top">Here is your main contents</td>
      </tr>
    </table>
    Option 2: When you need to to use height="...%"
    When you do know the actual size that you need ( in your case because you don't know how many pixels high the browser will be) then you will have to break the rules. The W3C does not specify a table height property in the dtd. The way around it is to not use a dtd. I have tried this out in IE6, NN7.1 and FireBird 0.7. It DID work in all of these browsers. The only problem is that sometimes if you do not specify a dtd, the browser will use a default one anyway. Most HTML editors add a dtd at the top of your page by default. Just erase that and your problem is fixed.

    example of the default dtd that Dreamwearer MX gives you:
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>....
    basically just remove anything before the <html> tag

    ______________________
    ViewTopia Web Hosting
    Coming Soon!
    ViewTopia Web Hosting
    Coming Soon!

  7. #6
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    Note: height of 100% on a table is only supported in IE 5.0+

    If you plan on having your site available for a wide audience, you shouldn't count on this.

    You can use javascript to counter the problem.

  8. #7
    JR
    JR is offline
    Senior Member JR's Avatar
    Join Date
    Nov 2002
    Location
    UK
    Posts
    4,354
    Member #
    257
    But wouldn't using JavaScript just contradict what you said about 'if you want your site availiable for a wide audience'?
    JR

  9. #8
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    Not really... most people (around 99%) enable javascript in their browsers.

  10. #9
    Junior Member
    Join Date
    Oct 2003
    Location
    New York
    Posts
    13
    Member #
    3580
    well the height=100% worked in IE6, NN 7.1, Firebird, and Konqueror. I didn't give it a try in NN 4 so I dont know. And if i remember correctly Opera supports it too. But, yeah, i wouldn't rely on it for something mission critical.

    would you mind giving an example of the JS way to do it.


    ____________________
    ViewTopia Web Hosting
    Coming Soon!
    ViewTopia Web Hosting
    Coming Soon!

  11. #10
    JR
    JR is offline
    Senior Member JR's Avatar
    Join Date
    Nov 2002
    Location
    UK
    Posts
    4,354
    Member #
    257
    Originally posted by transio
    Not really... most people (around 99%) enable javascript in their browsers.
    13% of people have JavaScript off
    59% use IE6 and 34% use IE5 = 93%
    (http://www.w3schools.com/browsers/browsers_stats.asp)

    But of course, it will depend on who is using your website.
    JR


Page 1 of 2 1 2 LastLast

Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 09:29 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com