Images in Table Cells

M

MrC

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.

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.

Thanks....
 
N

nice.guy.nige

While the city slept, MrC ([email protected]) feverishly typed...
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.

This is your problem.
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.

A table cell will always expand to accomodate the size of its content.
I tried the height and width parms in the IMG tag and some of the
thumbnails were distorted.

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
somewhere! ;-)
Is there some technique I can use for the thumbnails without having to
individually crop the images to the cell size.

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.

Cheers,
Nige
 
S

Sid Ismail

: 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
maintained.

Sid
 
D

Dan Abrey

Sid Ismail said:
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
maintained.

Or just resize as you wish in an image editor - just editing the "height" or
"width" in the HTML is going to distort them in a quality sense anyway.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,745
Messages
2,569,485
Members
44,909
Latest member
DestinyKetoScam

Latest Threads

Top