Html 如何在oracle程序表上添加背景图像

Html 如何在oracle程序表上添加背景图像,html,oracle,stored-procedures,html-email,Html,Oracle,Stored Procedures,Html Email,我正在尝试在oracle中的表中添加背景图像。这是我的密码。发送电子邮件时,图像不会显示在表格的背景中。这存储在一个过程中 <table width="100%" style="background:url(http://linktomyimage.png); background-repeat:no-repeat;"> <tr> for i in (select doc, source, title from table) loop msg_html

我正在尝试在oracle中的表中添加背景图像。这是我的密码。发送电子邮件时,图像不会显示在表格的背景中。这存储在一个过程中

<table width="100%" style="background:url(http://linktomyimage.png);  background-repeat:no-repeat;">
   <tr>

for i in (select doc, source, title from table)
loop
    msg_html := msg_html ||'<td>'||'i.doc||'</td><td>'||'i.source||'</td><td>'||'i.title||'</td>
end loop;
    msg_html := msg_html ||'</tr></table>';

我知道存在一些验证问题,但我认为问题在于,电子邮件客户端对背景图像的支持不一致

现在,有一种方法可以得到它,因此大多数电子邮件客户端都会接受它,但它需要相当多的代码,并且可能变得复杂

必须在HTML属性background=和CSSbackground image:urlhtp://中声明背景。它还需要在VBA for Outlook中完成

开始使用这些工具的好地方是:

他们为你做了大部分的基础工作,包括设置背景图像和后备颜色等

例如:

<td background="https://i.imgur.com/YJOX1PC.png" bgcolor="#7bceeb" width="120" height="92" valign="top" style="background-image: url(https://i.imgur.com/YJOX1PC.png); background-color:#7bceeb;" >
  <!--[if gte mso 9]>
  <v:rect xmlns:v="urn:schemas-microsoft-com:vml" fill="true" stroke="false" style="width:120px;height:92px;">
    <v:fill type="tile" src="https://i.imgur.com/YJOX1PC.png" color="#7bceeb" />
    <v:textbox inset="0,0,0,0">
  <![endif]-->
  <div>
   INSERT CONTENT HERE
  </div>
  <!--[if gte mso 9]>
    </v:textbox>
  </v:rect>
  <![endif]-->
</td>
根据您提供的代码:

 <td background="https://i.imgur.com/YJOX1PC.png" bgcolor="#7bceeb" width="120" height="92" valign="top" style="background-image: url(https://i.imgur.com/YJOX1PC.png); background-color:#7bceeb;" >
  <!--[if gte mso 9]>
  <v:rect xmlns:v="urn:schemas-microsoft-com:vml" fill="true" stroke="false" style="width:120px;height:92px;">
    <v:fill type="tile" src="https://i.imgur.com/YJOX1PC.png" color="#7bceeb" />
    <v:textbox inset="0,0,0,0">
  <![endif]-->
  <div>
        msg_html := msg_html || '<table width="100%">
                          <tr>
                            <td nowrap style="font-weight: bold;">Document</td>
                            <th nowrap style="font-weight: bold; text-align:left;">Collections</td>
                            <th nowrap style="font-weight: bold; text-align:left;">Title</td>
                          </tr>
                          <tr style="background-color: #ffffff;">';
for i in (select DOCNO, SOURCE, TITLE, GUIDE from tablename)
loop
        msg_html := msg_html || '<td nowrap class="leftAlignment"><a href="http://mywebsite.com?guideURL='''||i.guide||'''&docnum='''||i.docno||'''">DocNum</a></td>
        <td nowrap class="leftAlignment">'||i.source|| '</td>
        <td nowrap class="leftAlignment">'||i.title|| '</td>
        <td nowrap class="leftAlignment">'||i.source||'</td>
        <td class="leftAlignment"></td></tr><tr class="read">';
 end loop;

 msg_html :=msg_html ||'<td class="leftAlignment"></td></tr>

  <!--[if gte mso 9]>
    </v:textbox>
  </v:rect>
  <![endif]-->
   </div>
   </table>
</td>

问题似乎是您忘记关闭脚本中的table标记和保存脚本的div标记。如果你关闭这些,我相信它应该会起作用。

我在你的html中看到一个arror:td>首先,检查最终生成的电子邮件源中的html错误并更正它们。其次,请注意,在许多电子邮件客户端中,背景图像的处理是不一致的,尤其是outlook:这很奇怪,因为它在td中工作得很好,但当我将其放在表中时,它没有固定,仍然不工作。您所显示的循环中存在单引号问题,样式字符串末尾缺少双引号。你能展示你用来生成整个东西的实际代码吗,最好是你收到的电子邮件中显示的生成的HTML。