Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Image size same as td but still resizing

Status
Not open for further replies.
Sep 14, 1999
9
US
I have a table with variable and static widths and static heights for the cells. When I have a completely static cell and put in an image that is the exact size of the static cell it is making the cell 5 pixels higher. These extra pixels are showing up under the image. When I make the image height 5 pixels shorter then it fits. How can I make it fit the way it should.

An example is that if <td height=&quot;65&quot; width=&quot;260&quot;> and the image has the same dimensions the cell actually displays as 70px. If I make the image only 60px then the cell displays as 65px.

Can anyone help me. This is throwing the whole table off.
 
Two things to consider. Are other cells, either rows or columns, that are in line with this cell variable? They could be buldging bigger than 65.

As funny as this sounds, be sure in your HTML code there is not a line break for that <td> ie:
ok:
Code:
<td height=&quot;65&quot; width=&quot;260&quot;><img src=&quot;mypic.gif</td>

not:
Code:
<td height=&quot;65&quot; width=&quot;260&quot;>
<img src=&quot;mypic.gif</td>
DeZiner
gear.gif width=45 align=left
When the gears stop turning,
we all stop learning.
 
That did not format well, the first ie should be one continuous line where as the second is split on two lines DeZiner
gear.gif width=45 align=left
When the gears stop turning,
we all stop learning.
 
Tried setting cellpadding and cellspacing to 0 ? How about changing the hspace and vspace attributes in the img tags? These are more than likely your problem. Putting the <td> and </td> tags on seperate lines will also sometimes cause this (usually in netscape). -gerrygerry
Go To
 
It was the </td> tag being on a different line. Fixing it makes the code hard to read (there are several other lines of ColdFusion code in there as well), but it renders properly. Thanks for your help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top