Image width fit to table cell

Ok, I'd like to stay away from javascript and all that.<br />
<br />
What I've got is this: A table layed out using only percentages for width and height. (Please don't flame me for this) I have an image that is a bit too wide for one of the cells so it stretches it and breaks the whole table horribly. I've tried width=100% for the image, but I guess specifying a width like that is in relation to the original size of the image. Is there any way to make the image fir snug to the cell?<br />
<br />
I haven't tried divs yet, maybe there's something in CSS that can help. Thanks in advance.<!--content-->Try using the image as the background in the table cell.<br />
<br />
<td style="background: url(MyImage.gif) no-repeat fixed left;"></td><br />
<br />
You may have to add height and width attributes to the cell to see enough of the image.<!--content-->Hrm...I was hoping to maybe use the image as a link, but I'll give that a shot, and if it works I'll call it good. For now at least, keep the suggestions rolling though!<br />
<br />
EDIT: Ok, that sorta worked. It fixed the stretching problem, but now part of the image gets chopped to the right. I'm too tired to try and play a little bit more with it tonight. I'll try a few other ideas that sorta popped into my head later.<!--content-->
 
Back
Top