我正在使用<td>
和<tr>
进行电子邮件营销。除2个主要图像外,所有图像均已就绪。
我尝试不添加display:block,尝试添加它,尝试了很多事情,将图像切成2等,但是这种情况一直在发生。
我将添加图片以更好地理解:
我做错了什么?
我正在使用的代码:
<table border="0" cellpadding="0" cellspacing="0" style="width:658px">
<tbody>
<tr>
<td> <td style="display: block"></td><img src="Images that are ok"> <img src="Images that are ok"> <img src="Images that are ok"> <img src="Images that are ok">
</td> <td>
<td style="display: block"></td> <img src="Images that are causing trouble"><img src="Images that are causing trouble"></td><br>
<td> <td style="display: block"></td>
<img src="Images that are ok"> <img src="Images that are ok"><img src="Images that are ok"></td>
</tr>
编辑:我解决了这个问题,但是现在即使在使用“ display:block”时,每个图像之间也有空白。我该怎么办?
答案 0 :(得分:0)
我会从所有style="display: block"
中删除td
–这将覆盖/取消其表单元格属性,这可能是造成麻烦的主要原因(此外,如注释中所述,您不应该'请将td
嵌套在另一个td
中)。
答案 1 :(得分:0)
<table border="0" cellpadding="0" cellspacing="0" style="width:658px">
<tbody>
<tr>
<td>
<img src="Images that are ok">
<img src="Images that are ok">
<img src="Images that are ok">
<img src="Images that are ok">
</td>
<td>
<img src="Images that are causing trouble">
<img src="Images that are causing trouble">
</td>
<br>
<td>
<img src="Images that are ok">
<img src="Images that are ok">
<img src="Images that are ok">
</td>
</tr>
</tbody>
</table>
答案 2 :(得分:0)
主要问题是您在一个td
中使用了多个tr
。一个tr是一行,每个td
将该行拆分为另一列。如果要使图像一个接一个,则需要使用多行。
此外,您的代码不太正确。您需要删除td
中的嵌套td
。在br
之间的td
也是一个坏主意。
<table border="0" cellpadding="0" cellspacing="0" style="width:658px">
<tbody>
<tr>
<td> <img src="Images that are ok"> <img src="Images that are ok"> <img src="Images that are ok"> <img src="Images that are ok">
</td>
答案 3 :(得分:0)
您的代码中嵌套了一个额外的TD标记。
这应该有效:
<table border="0" cellpadding="0" cellspacing="0" style="width:658px">
<tbody>
<tr>
<td style="display: block">
<img src="Images that are ok"> <img src="Images that are ok"> <img src="Images that are ok"> <img src="Images that are ok">
</td>
<td style="display: block">
<img src="Images that are causing trouble"><img src="Images that are causing trouble">
</td>
<td style="display: block">
<img src="Images that are ok"> <img src="Images that are ok"><img src="Images that are ok">
</td>
</tr>
</tbody>