Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Images in Table Cells
October 5, 2004, 4:45 pm
rate this thread
larger version or the image. The images are all different sizes.
I tried to set the dimensions of the cells with width and height parms
in the TR/TD/TH tags but they are overridden by the size of the image.
I tried the height and width parms in the IMG tag and some of the
thumbnails were distorted.
Is there some technique I can use for the thumbnails without having to
individually crop the images to the cell size.
Re: Images in Table Cells
This is your problem.
A table cell will always expand to accomodate the size of its content.
What else did you expect? If you expand or contract an image so that its
aspect-ratio is changed, then the image is going to look weird. If you
expand an image to larger than it actually is then it is going to pixelate -
the same can be true for squashing them. Those spare pixels have to go
Not really I'm afraid. One technique I've seen is to physically crop the
image to a smaller size, so only a part of it is visible. While all your
thumbnails will be the same size, this can be confusing for the visitor, as
the full-size image is not the same as the thumbnail they selected. Also, it
will be difficult and time-consuming to accurately crop the images to
thumbnails that reflect the original, and make an interesting enough image
for the visitor to want to see the full size version.
As an alternative, are all the full size pictures you are referencing of the
same aspect-ratio (eg, 1:1.333, 300x400, 800x600, etc). If that is the case,
then make all your thumbnails the same length on the long side of the
picture (eg, for a 300x400 portrait format, shrink to 75x100. For a 400x300
landscape format, shrink to 100x75), then try and group your thumbnails in
an imaginative way in the table (eg, a row of landscape followed by a row of
portrait, or a portrait flanked by a landscape either side, then a landscape
flanked by a portrait either side on the next row). All your thumbnails will
be of a same or similar size, but the orientation will be different, so you
will be someway to a reasonably neat layout.
Hope that makes sense, and helps.
Mail address not valid. nigel@DOG.nigenet.org.uk, take the DOG. out!
In the land of the blind, the one-eyed man is very, very busy!
Re: Images in Table Cells
: I have a table of thumbnail images that can each be clicked on to see a
: larger version or the image. The images are all different sizes.
: I tried to set the dimensions of the cells with width and height parms
: in the TR/TD/TH tags but they are overridden by the size of the image.
The img size takes precedence.
: I tried the height and width parms in the IMG tag and some of the
: thumbnails were distorted.
Of course it will distort, since the ratio of height:width is distorted. Do
this: specify height only, or width only, not both. The ratio is