Forum Moderators: open
I only see the problem in IE as well, Netscape shows the image aligned right just fine.
I get the same thing in a simplified case as well:
<table width="400" border="1" cellpadding="0" cellspacing="0">
<tr><td><img src="images/rightimage.jpg" border="0" width="214" height="166" alt="" align="right" />
</td></tr>
<table>
Does anyone know what's going on and if I can fix it?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
the image also sits flush even without the hspace="0". It doesn't happen in IE5 or 5.5 though.
I hope Ouroboros doesn't mind me answering that hspace is for horizontal padding. All other content will sit that far away from the image on the left and right. There is also a vspace attribute for vertical spacing. I don't think they are valid tags past HTML 4.01 though where you should use:
style="padding-left:5px;padding-top:3px;"
to do the same job.
<table cellpadding="0" cellspacing="0" width="400" border="1" cellpadding="0" cellspacing="0">
<tr>
<td>
<img align="right" src="image.gif" border="0" width="214" height="166" hspace="0" alt="" />
</td>
</tr>
</table>
There are a lot of deprecated tags in this code and depending on your DTD you may see different results.
As klogger pointed out CSS is the way to go here and it will allow the removal of all the deprecated tags.
HTH
<table cellpadding="0" cellspacing="0" width="400" border="1" cellpadding="0" cellspacing="0">
<tr>
<td>
<img align="right" src="image.gif" border="0" width="214" height="166" hspace="0" alt="" />
</td>
</tr>
</table>
There are a lot of deprecated tags in this code and depending on your DTD you may see different results.
As klogger pointed out CSS is the way to go here and it will allow the removal of all the deprecated tags.
HTH