Hello, I was wondering if there would be a way I could place an image without it overflowing. So say if there is images within each table cell in a row where each cell is 25 x 25, and the image is 50 x 50, I want to place the 50 x 50 image at full size within each cell, without the image overflowing into the next cell, while keeping each cell 25 x 25.

Recommended Answers

All 11 Replies

So you want a 50x50 image to fit inside a 25x25 cell? It sounds like you are trying to fit 48 ounces of water into a 24 ounce bottle. I'm sorry but I'm not understanding what you ask.

I guess I didn't explain this too well, the reasoning behind this is, that some images are too narrow when they get scaled down, so I want to place the big image so that problem doesn't occur. e.g. say you have an image that is 30x90, and one that is 50x50. When you place the images in the 25x25 cell, and have them fit proportions, the 30x90 one won't fill out completely on the side, but the 50 x 50 one will.

That is as clear as a mud puddle.

What do you WANT it to do?

You have the following choices:

- Use an image editor to either crop or shrink the image until it is 25X25. (Is that pixels, cm, or what?)

- Do the same, but save it as a second image file for use in the table. and use the full image elsewhere.

- Make the table cells big enough to hold the images.

- Make the image a background inside a div pair, inside the td pair.

Well let's say you have an image that is 500 x 500 pixels right? And then let's say you only want to display 100 x 100 pixels of it, but you want it to be only part of the image that is displayed so the 100 x 100 part being displayed is only a section of the image, not the entire thing. So in essence you are only displaying a cropped part of the image. The thing is I can't just crop single images, since they are being dynamically pulled out from a directory by php. Make sense now?

mmm i think there's no solution to fit all of your image in 25x25 cell (because your images not all in square). If you push it that way you can set default value for height or width in your php script. But i think its better to make image thumbnails to fit in your cell (just like midimagic said)

is it a question how it possible once think when you post a query in forum is it right question or not?

is it a question how it possible once think when you post a query in forum is it right question or not?

I can't understand what you are asking. Maybe you could use a translator before you post a query? http://babelfish.yahoo.com/

In theory it should be possible, but I am posting here to see if anyone knows a way to do it, I deal more with server side stuff so I don't know a whole lot about css or javascript, which is why I post here a lot!

try applying this style to a div pair inside the table cell. .imlim {width: 25px; height: 25px; overflow: hidden;}

This thread should have been marked as solved by MidiMagic by now.

Only people who can mark thread as solved is original poster or member of moderators team, but we usually leave it to poster

I guess that my statement:

This thread should have been marked as solved by MidiMagic by now.

was not well-formed and can be interpereted incorrectly.

To avoid confusion, I should have used quotes like in:
This thread should have been marked as "solved by MidiMagic" by now.

Meaning:
thread Status = "solved";
solution Author = "MidiMagic";
marker ID = "";
----------------
Marker ID vas not defined.
Regards.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.