开发者

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

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

How to make same size image in <table> / &开发者_JAVA技巧lt;td>, but image diffrent size.

for view My site click here : promolagi.com

Thanks.


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="..." />


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.


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜