Click to See Complete Forum and Search --> : [RESOLVED] Making a table cell fit the image inside it


drennan
07-07-2008, 10:28 AM
I'm really struggling with dreamweaver when it comes to placing images within table cells. If i've got an image of 20x20 pixels and I insert it into the first cell of the table, I would have thought I could just drag the cell borders so the cell is exactly 20x20 pixels. This rarely happens. There is normally a gap somewhere around the image so the cell ends up being 21 x 22 for example. I can sometimes get it right by fiddling with loads of settings (such as the paragraph settings of the cells on that row, border settings etc) but I just cant get it working this time. Am I missing something obvious? Is there a way of forcing the cell to be 20x20 or the size of the image within it?? For some reason, height/width in the properties inspector doesn't make any difference. I'm relatively new to DW. Thanks, Dren.

eCat
07-07-2008, 11:53 AM
Make sure that your table properties don't include any padding:

border="0" cellpadding="0" cellspacing="0"

Also make sure you don't have any blank spaces around your image (like a <br> tag) and that your image isn't sitting inside of a <p> tag.

If you're still having problems, please post a snippet of code.

eCat

drennan
07-07-2008, 12:07 PM
I've zoomed right in and cant see anything else in the cell. The table has a cellspace of 1 so the cells all show a border. Here is the code from the cell.

<td width="20" height="20" align="center" valign="middle" bordercolor="#000000" background="orange_light.jpg" bgcolor="#FFFFFF" class="leftAlign" scope="row"><img src="images/20x20/bread_white.jpg" alt="click to zoom" width="20" height="20"></td>

eCat
07-07-2008, 12:21 PM
When I copied that into Dreamweaver myself (with a test image) I don't see any gaps. But it's hard to say without seeing the rest of the table's code. All I see is the cell border - no other spaces.

drennan
07-07-2008, 12:27 PM
I just uploaded the form to some webspace to show you and it looks fine once uploaded!? If i preview locally in safari I get gaps but no gaps when uploaded. Weird. Well its not too much of a problem in that case. Thanks for your help

eCat
07-07-2008, 12:52 PM
Don't you hate that? LOL!

Glad it's working for you.