Can a <p> go in a <td> tag?

Hi,

This is some of my code.

<td valign="top" align="center" bgcolor='#5487be' ><a href="#" target="_blank" style="text-decoration: none;"> <img src="images/eff1cover.jpg" alt="cover" width="84" height="107"  border="0"> <p style="font-family:Arial, Helvetica, sans-serif; font-size:11px; line-height:4px; letter-spacing:1px; color:#FFFFFF; padding-bottom:8px;"> Print Edition</p></a></td></tr>

The w3.org validator is stating that I cannot have a <p> in here. What would you use instead? Or should I not be putting an image and copy together in one cell?

Thanks for your help
Meryl

The <p> can’t go inside the <a> tag. If you get rid of the <a> tag then the <p> inside the <td> will be valid.

Code validated correctly now. Thank you.

Is this how the <a> tag should be added then?

<tr>
<td valign="top" align="center" bgcolor='#92278f'> <a href="#" target="_blank" style="text-decoration: none;"><img src="http://www.sitepoint.com/forums/images/eff1laptop.jpg" alt="cover" width="123" height="107"  border="0"></a> <p style="font-family:Arial, Helvetica, sans-serif; font-size:11px; line-height:4px; letter-spacing:1px; color:#FFFFFF; padding-bottom:8px;"><a href="#" target="_blank" style="text-decoration: none;"> AdAge.com</a></p></td></tr>

It looks okay, if you don’t want to link the text as well as the image, but I have to wonder why you’re using such a wealth of deprecated and obsolete code.

Code mavens, does he have to wrap the IMG inside a P or other block tag?

I think I would go for something like
<td><p><a><img><br>text</a></p></td>
although I really can’t see why the <p> is needed at all, since <td> can contain loose text.

This code is for an html email. So I need to use tables.

Ok, html mail… But why is the <p> in there?

Good question. Really because that is how the previous programmer set it up. Also the <p> tag helps divide up paragraphs with more space on top and bottom.