views:

394

answers:

4

I have many images to showing in to the <table> or <td>

How to make same size image in <table> / <td>, but image diffrent size.

for view My site click here : promolagi.com

Thanks.

A: 

When you build an image you can set its height and width to be constant.

<img src="..." width="50" height="50" />

Bear in mind it will be stretch your image to fit the size you desire and the quality will be reduced.

Faruz
if using <img src="..." width="50" height="50" />that's not proportional.example : image 1 : 200x120image 2 : 300x 100all image is diffrent sizethank
Iwan
If you just set one of them (height or width) it will keep the proportions
Faruz
yes, now I just set height=150px, but, yeah...it looks like now. not good
Iwan
A: 

In your CSS :

table img{
  width:200px;
  height: 300px;
}

Like this all your images in a table will have 200x300px of size.

You can specify this for each image:

<img style="height:200px" src="..." />

or

<img height="200px" src="..." />
marcgg
yes, my script now is <img height="200px" src="..." /> but, yeah...it looks like now
Iwan
A: 

Add a div in the td set the size of the div to be the size that you want the image displayed and then set the overflow to be hidden. This should then only show part of the image but it will always be the same size.

matpol
A: 

If I understand your question correctly, you have images that are of different size and you want to create thumbnails that are all the same size.

You need to create new image files, thumbnail images that you store in the server. (It is not good idea to use full size images and let the browser to resize them.)

You can create the thumbnail images using an image manipulation program (Photoshop, PSP, Gimp etc.). Usually these have batch processing option for handling multiple images.

Or use command line based image editor, ImageMagic, which is handy for doing batch jobs.

Or use a dedicated thumbnail generator program. There are many free alternatives (Google for thumbnail image generator).

Since the images have different proportions, you must decide what you mean by "same size". The same width or same height, or the same maximum dimension (must fit inside a specified rectangle), or the same area. The thumbnail generator program usually allows you to choose any of these options. Then it generates thumbnails for example for all the images in a specific folder.

Many of these programs can also generate html code for an image gallery.

PauliL