Results 1 to 2 of 2

Thread: Use CSS to "lock" a height of a table to 250px

  1. #1
    Join Date
    Sep 2006
    Location
    Menomonee Falls, WI
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Use CSS to "lock" a height of a table to 250px

    Hello-
    Is there a way to "lock" the height of a table to 250px using css? I have a 2 col, 1 row table that will have a an image in the left cell. The image will change, but will never be wider than 256px. The image height will be proportionate to the width. The text in the right-hand cell, however, will vary in height. My client never wants to have a gap of white space, under the image, if this text is longer than the image height. So is there a way to "lock" the height of the table, so no matter how long text is, it won't show, or gets cut off?

    This is what I currently have in my code in the <head> section:
    <style>
    #tableht {height: 250px}
    </style>

    and have applied the class in my table like this <table id=tableht" width="100%" border="0" align="center">

    Is there something wrong in my code or isn't this possible to do? Any help you can provide would be greatly appreciated.

    Thanks much,
    Kirsten

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    It will work, but not in IE, which expands elements to accommodate their content and totally ignores your code unless you set overflow:hidden (or :scroll). However, this is not a good idea, since it lowers the overall flexibility of your page.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

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
  •