SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Evangelist
    Join Date
    Jan 2005
    Location
    bahrain
    Posts
    553
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thumbs up problem with table height

    hi
    i m trying to give height to a table like this in XHTML

    HTML Code:
    <table style="width:779px; height:100% border:0" align="center" cellpadding="0" cellspacing="0">
    but not taking height

    how can i specify the height of table to 100% in XHTML
    yes when i m deleting this it i swroing well but not with this

    HTML Code:
    <!DOCTYPE html PUBLIC
    "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-Transitional.dtd">
    but i have to use it for XHTML
    its urgent plzzz.....
    regards
    phphelp

  2. #2
    SitePoint Zealot southernlady's Avatar
    Join Date
    Mar 2005
    Location
    TN
    Posts
    120
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    In your example, your table width is definded by an exact number...width:779px;

    You would be much better off using percentages in a table for width instead of pixels. That way, if someone is using a screen resolution of 1024 x 768 instead of 800 x 600, the table will automatically resize itself to fill the screen.

    As far as height, I don't have that answer, unfortunately. Liz

  3. #3
    Word Painter silver trophy Shyflower's Avatar
    Join Date
    Oct 2003
    Location
    Winona, MN USA
    Posts
    10,053
    Mentioned
    142 Post(s)
    Tagged
    2 Thread(s)
    You can't display table height in percentages. Unless you declare a height (i.e. "600") the table will only be as tall as the content you put inside. Of course, "content" includes cells where you have declared the heights of the individual cell.
    Linda Jenkinson
    "Say what you mean. Mean what you say. But don't say it mean." ~Unknown

  4. #4
    SitePoint Guru puco's Avatar
    Join Date
    Feb 2005
    Location
    Slovakia
    Posts
    785
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    html, body { height: 100% }
    How come noone uses the search function on this forum. There is literally the same topic a few post up.
    Martin Pernecky

  5. #5
    SitePoint Enthusiast
    Join Date
    Jan 2005
    Posts
    31
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Talking

    <!DOCTYPE html PUBLIC
    "-//W3C//DTD XHTML 1.0 Transitional//EN">

    you can also ditch the link from the doctype like the one above and then set height="100%" for your table...
    With The Right Design in Mind --> OutRight Technologies

    www.outrighttech.com

  6. #6
    SitePoint Wizard silver trophybronze trophy Nadia P's Avatar
    Join Date
    Oct 2004
    Location
    NSW Australia
    Posts
    3,564
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ort
    <!DOCTYPE html PUBLIC
    "-//W3C//DTD XHTML 1.0 Transitional//EN">

    you can also ditch the link from the doctype like the one above and then set height="100%" for your table...
    Why would you do that - it is not valid code and removing the doc type puts the browser in to quirks mode, so yes, it may very well render like you want in IE, but will not in complaint browsers......

    Here is a way that you can accomplish what you want and using valid code.
    http://apptools.com/examples/tableheight.php

    Nadia


Bookmarks

Posting Permissions

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