www.webdeveloper.com
Results 1 to 8 of 8

Thread: HELP>>Resize Image within table

  1. #1
    Join Date
    Feb 2003
    Posts
    1

    Question HELP>>Resize Image within table

    I want an image to resize within a table that is set at 100% so that the image is the largest it can be within the table without the horizontal scroll bar activating.

  2. #2
    Join Date
    Dec 2002
    Location
    Lake Havasu City, Arizona
    Posts
    527

    Re: HELP>>Resize Image within table

    Originally posted by capctycr
    I want an image to resize within a table that is set at 100% so that the image is the largest it can be within the table without the horizontal scroll bar activating.
    I don't think you can get it to re-size. You might have to use pixels in the table as well as for the image.
    The reason is that the table set to percents will fill the screen regardless of the resolution the viewers have, while the image size is set to pixels will not.
    Make table that is centered say about 800 and the image about 790. that allows for cellpadding. The reason for a centered table is so it wouldn't look one sided in a higher resolution. Center the image for the same reasons too.

  3. #3
    Join Date
    Dec 2002
    Location
    High on life
    Posts
    10,104
    Actually, you can.

    <img src="your.gif" height="100%" width="100%"> will fill the cell that it is in.

    Personal website http://www.ryanbrill.com/
    Business website: http://www.infinitywebdesign.com/
    TypeSpace http://www.typespace.org/

    I reject your reality and substitute it with my own!

  4. #4
    Join Date
    Dec 2002
    Location
    Lake Havasu City, Arizona
    Posts
    527
    Will that override the set image sizes? If it does, the image will be distorted or stretched one way or the other to fit the screen?

  5. #5
    Join Date
    Nov 2002
    Posts
    631
    Yeah. That will override the images set sizes unless the table is the size of the image. Then everything should be fine.

  6. #6
    Join Date
    Dec 2002
    Location
    High on life
    Posts
    10,104
    Yes, but it should work to only set the height, something like <img src="your.gif" height="100%">. This should keep it proportionally correct.

    Personal website http://www.ryanbrill.com/
    Business website: http://www.infinitywebdesign.com/
    TypeSpace http://www.typespace.org/

    I reject your reality and substitute it with my own!

  7. #7
    Join Date
    Dec 2002
    Location
    Lake Havasu City, Arizona
    Posts
    527
    I tried a sample. If there is any description under the image it will cause a scroll bar. In other words nothing else can be on the page.
    But the image is distorted. So for various screen sizes it would not show the same.
    Last edited by jdavia; 02-15-2003 at 01:36 PM.

  8. #8
    Join Date
    Dec 2002
    Location
    High on life
    Posts
    10,104
    I wasn't saying that it wouldn't distort the image. I was just trying to show that you can specify percentage widths. If you have text under it, try a percentage width like 90%.

    Personal website http://www.ryanbrill.com/
    Business website: http://www.infinitywebdesign.com/
    TypeSpace http://www.typespace.org/

    I reject your reality and substitute it with my own!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles