gpt4 book ai didi

Outlook 的 HTML 忽略了我的固定表格尺寸(即使在浏览器中)

转载 作者:行者123 更新时间:2023-11-28 00:30:56 27 4
gpt4 key购买 nike

我不是网络专家或编码员,只是系统管理员,所以我确定我只是犯了一些非常明显的基本错误。我已经为我们的备份系统创建了一个电子邮件报告,但格式让我抓狂。我知道 Outlook 创建了某些限制 - 特别是关于 CSS,但我不明白为什么我的格式设置如此之远。这是 HTML 的简化版本的图像:

enter image description here

“总计”框应与“备份类型”框对齐,但当我在 Chrome 中检查页面时,我可以看到第一个固定宽度为 900 的表格实际上是 918。这是我的 HTML :

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Email Report</title>
</head>
<body style='background-color:#dfdfdf;'>
<table style='width:100%;text-align:left;background-color:#dfdfdf;'>
<tr>
<td>
<br />
<table border='0' cellpadding='0' width='950' align='center' style='background-color:white; border:solid #bbbbbb 1.0pt; table-layout:fixed;'>
<tbody>
<tr>
<td>
<table border='0' width='900' cellpadding='0' align='center' style='border-collapse: collapse; table-layout:fixed;'>
<tbody>
<tr>
<td style='background-color: #ebf0f8; border: solid #dddddd 1.0pt; padding-left: 5px;' width='275'><strong><span style='font-size: 8.5pt; font-family: Arial,sans-serif; color: #444444;'>Backed up item</span></strong></td>
<td align='center' style='background-color: #ebf0f8; border: solid #dddddd 1.0pt;' width='65'><strong><span style='font-size: 8.5pt; font-family: Arial,sans-serif; color: #444444;'>Back up type</span></strong></td>
<td align='center' style='background-color: #ebf0f8; border: solid #dddddd 1.0pt;' width='70'><strong><span style='font-size: 8.5pt; font-family: Arial,sans-serif; color: #444444;'>Replica Space</span></strong></td>
<td align='center' style='background-color: #ebf0f8; border: solid #dddddd 1.0pt;' width='70'><strong><span style='font-size: 8.5pt; font-family: Arial,sans-serif; color: #444444;'>Recovery Space</span></strong></td>
<td align='center' style='background-color: #ebf0f8; border: solid #dddddd 1.0pt;' width='60'><strong><span style='font-size: 8.5pt; font-family: Arial,sans-serif; color: #444444;'>Recovery Days</span></strong></td>
<td align='center' style='background-color: #ebf0f8; border: solid #dddddd 1.0pt;' width='65'><strong><span style='font-size: 8.5pt; font-family: Arial,sans-serif; color: #444444;'>Recovery Points</span></strong></td>
<td align='center' style='background-color: #ebf0f8; border: solid #dddddd 1.0pt;' width='115'><strong><span style='font-size: 8.5pt; font-family: Arial,sans-serif; color: #444444;'>Last On-Site Backup</span></strong></td>
<td align='center' style='background-color: #ebf0f8; border: solid #dddddd 1.0pt;' width='115'><strong><span style='font-size: 8.5pt; font-family: Arial,sans-serif; color: #444444;'>Last Azure Backup</span></strong></td>
<td align='center' style='background-color: #ebf0f8; border: solid #dddddd 1.0pt;' width='65'><strong><span style='font-size: 8.5pt; font-family: Arial,sans-serif; color: #444444;'>Status</span></strong></td>
</tr>
<tr>
<td style='background-color: #ffffff; border: solid #dddddd 1.0pt; border-collapse: collapse; padding-left: 5px;' width='275'><span style='font-size: 8.5pt; font-family: Arial,sans-serif; color:#444444;'>ReportServer$DPM2016TempDB</span></td>
<td align='center' style='background-color: #ffffff; border: solid #dddddd 1.0pt; border-collapse: collapse;' width='65'><span style='font-size: 8.5pt; font-family: Arial,sans-serif; color:#444444;'>SQL Data</span></td>
<td align='center' style='background-color: #ffffff; border: solid #dddddd 1.0pt; border-collapse: collapse;' width='70'><span style='font-size: 8.5pt; font-family: Arial,sans-serif; color:#444444;'>1 GB</span></td>
<td align='center' style='background-color: #ffffff; border: solid #dddddd 1.0pt; border-collapse: collapse;' width='70'><span style='font-size: 8.5pt; font-family: Arial,sans-serif; color:#444444;'>1 GB</span></td>
<td align='center' style='background-color: #ffffff; border: solid #dddddd 1.0pt; border-collapse: collapse;' width='60'><span style='font-size: 8.5pt; font-family: Arial,sans-serif; color:#444444;'>30</span></td>
<td align='center' style='background-color: #ffffff; border: solid #dddddd 1.0pt; border-collapse: collapse;' width='65'><span style='font-size: 8.5pt; font-family: Arial,sans-serif; color:#444444;'>30</span></td>
<td align='center' style='background-color: #ffffff; border: solid #dddddd 1.0pt; border-collapse: collapse;' width='115'><span style='font-size: 8.5pt; font-family: Arial,sans-serif; color:444444;'>20:01 28/01/2019</span></td>
<td align='center' style='background-color: #ffffff; border: solid #dddddd 1.0pt; border-collapse: collapse;' width='115'><span style='font-size: 8.5pt; font-family: Arial,sans-serif; color: #444444;'>N/A</span></td>
<td align='center' style='background-color: #ffffff; border: solid #dddddd 1.0pt; border-collapse: collapse;' width='65'><span style='font-size: 8.5pt; font-family: Arial,sans-serif; color:#444444;'><strong style='color:#008100;'>SUCCESS</strong></span></td>
</tr>
</tbody>
</table>
<table border='0' width='900' cellpadding='0' align='center' style='border-collapse: collapse;table-layout:fixed;'>
<tbody>
<tr>
<td style='background-color: #ffffff; border: solid #ffffff 1.0pt; border-collapse: collapse; padding-left: 5px;' width='275'><span style='font-size: 8.5pt; font-family: Arial,sans-serif; color: #444444;'>&nbsp;</span></td>
<td align='center' style='background-color: #ebf0f8; border: solid #dddddd 1.0pt; border-collapse: collapse;' width='65'><span style='font-size: 8.5pt; font-family: Arial,sans-serif; color: #444444;'>Totals</span></td>
<td align='center' style='background-color: #ebf0f8; border: solid #dddddd 1.0pt; border-collapse: collapse;' width='70'><span style='font-size: 8.5pt; font-family: Arial,sans-serif; color: #444444;'>6 GB</span></td>
<td align='center' style='background-color: #ebf0f8; border: solid #dddddd 1.0pt; border-collapse: collapse;' width='70'><span style='font-size: 8.5pt; font-family: Arial,sans-serif; color: #444444;'>12 GB</span></td>
<td align='center' style='background-color: #ffffff; border: solid #ffffff 1.0pt; border-collapse: collapse;' width='420'><span style='font-size: 8.5pt; font-family: Arial,sans-serif; color: #444444;'>&nbsp;</span></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</table>
</body>
</html>

如有任何提示,我们将不胜感激。

最佳答案

以“总计”开头的行包含在一个完全独立的表格中,位于主表格的底部。

这里有几个选项,但最快的解决方法是简单地删除结束上面表格的标签并开始一个新表格:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Email Report</title>
</head>
<body style='background-color:#dfdfdf;'>
<table style='width:100%;text-align:left;background-color:#dfdfdf;'>
<tr>
<td>
<br />
<table border='0' cellpadding='0' width='950' align='center' style='background-color:white; border:solid #bbbbbb 1.0pt; table-layout:fixed;'>
<tbody>
<tr>
<td>
<table border='0' width='900' cellpadding='0' align='center' style='border-collapse: collapse; table-layout:fixed;'>
<tbody>
<tr>
<td style='background-color: #ebf0f8; border: solid #dddddd 1.0pt; padding-left: 5px;' width='275'><strong><span style='font-size: 8.5pt; font-family: Arial,sans-serif; color: #444444;'>Backed up item</span></strong></td>
<td align='center' style='background-color: #ebf0f8; border: solid #dddddd 1.0pt;' width='65'><strong><span style='font-size: 8.5pt; font-family: Arial,sans-serif; color: #444444;'>Back up type</span></strong></td>
<td align='center' style='background-color: #ebf0f8; border: solid #dddddd 1.0pt;' width='70'><strong><span style='font-size: 8.5pt; font-family: Arial,sans-serif; color: #444444;'>Replica Space</span></strong></td>
<td align='center' style='background-color: #ebf0f8; border: solid #dddddd 1.0pt;' width='70'><strong><span style='font-size: 8.5pt; font-family: Arial,sans-serif; color: #444444;'>Recovery Space</span></strong></td>
<td align='center' style='background-color: #ebf0f8; border: solid #dddddd 1.0pt;' width='60'><strong><span style='font-size: 8.5pt; font-family: Arial,sans-serif; color: #444444;'>Recovery Days</span></strong></td>
<td align='center' style='background-color: #ebf0f8; border: solid #dddddd 1.0pt;' width='65'><strong><span style='font-size: 8.5pt; font-family: Arial,sans-serif; color: #444444;'>Recovery Points</span></strong></td>
<td align='center' style='background-color: #ebf0f8; border: solid #dddddd 1.0pt;' width='115'><strong><span style='font-size: 8.5pt; font-family: Arial,sans-serif; color: #444444;'>Last On-Site Backup</span></strong></td>
<td align='center' style='background-color: #ebf0f8; border: solid #dddddd 1.0pt;' width='115'><strong><span style='font-size: 8.5pt; font-family: Arial,sans-serif; color: #444444;'>Last Azure Backup</span></strong></td>
<td align='center' style='background-color: #ebf0f8; border: solid #dddddd 1.0pt;' width='65'><strong><span style='font-size: 8.5pt; font-family: Arial,sans-serif; color: #444444;'>Status</span></strong></td>
</tr>
<tr>
<td style='background-color: #ffffff; border: solid #dddddd 1.0pt; border-collapse: collapse; padding-left: 5px;' width='275'><span style='font-size: 8.5pt; font-family: Arial,sans-serif; color:#444444;'>ReportServer$DPM2016TempDB</span></td>
<td align='center' style='background-color: #ffffff; border: solid #dddddd 1.0pt; border-collapse: collapse;' width='65'><span style='font-size: 8.5pt; font-family: Arial,sans-serif; color:#444444;'>SQL Data</span></td>
<td align='center' style='background-color: #ffffff; border: solid #dddddd 1.0pt; border-collapse: collapse;' width='70'><span style='font-size: 8.5pt; font-family: Arial,sans-serif; color:#444444;'>1 GB</span></td>
<td align='center' style='background-color: #ffffff; border: solid #dddddd 1.0pt; border-collapse: collapse;' width='70'><span style='font-size: 8.5pt; font-family: Arial,sans-serif; color:#444444;'>1 GB</span></td>
<td align='center' style='background-color: #ffffff; border: solid #dddddd 1.0pt; border-collapse: collapse;' width='60'><span style='font-size: 8.5pt; font-family: Arial,sans-serif; color:#444444;'>30</span></td>
<td align='center' style='background-color: #ffffff; border: solid #dddddd 1.0pt; border-collapse: collapse;' width='65'><span style='font-size: 8.5pt; font-family: Arial,sans-serif; color:#444444;'>30</span></td>
<td align='center' style='background-color: #ffffff; border: solid #dddddd 1.0pt; border-collapse: collapse;' width='115'><span style='font-size: 8.5pt; font-family: Arial,sans-serif; color:444444;'>20:01 28/01/2019</span></td>
<td align='center' style='background-color: #ffffff; border: solid #dddddd 1.0pt; border-collapse: collapse;' width='115'><span style='font-size: 8.5pt; font-family: Arial,sans-serif; color: #444444;'>N/A</span></td>
<td align='center' style='background-color: #ffffff; border: solid #dddddd 1.0pt; border-collapse: collapse;' width='65'><span style='font-size: 8.5pt; font-family: Arial,sans-serif; color:#444444;'><strong style='color:#008100;'>SUCCESS</strong></span></td>
</tr>
</tbody>
<!--
</table>
<table border='0' width='900' cellpadding='0' align='center' style='border-collapse: collapse;table-layout:fixed;'>
<tbody>
-->
<tr>
<td style='background-color: #ffffff; border: solid #dddddd 1.0pt; border-collapse: collapse; padding-left: 5px;' width='275'><span style='font-size: 8.5pt; font-family: Arial,sans-serif; color:#444444;'>&nbsp;</span></td>
<td align='center' style='background-color: #ebf0f8; border: solid #dddddd 1.0pt; border-collapse: collapse;' width='65'><span style='font-size: 8.5pt; font-family: Arial,sans-serif; color: #444444;'>Totals</span></td>
<td align='center' style='background-color: #ebf0f8; border: solid #dddddd 1.0pt; border-collapse: collapse;' width='70'><span style='font-size: 8.5pt; font-family: Arial,sans-serif; color: #444444;'>6 GB</span></td>
<td align='center' style='background-color: #ebf0f8; border: solid #dddddd 1.0pt; border-collapse: collapse;' width='70'><span style='font-size: 8.5pt; font-family: Arial,sans-serif; color: #444444;'>12 GB</span></td>
<td align='center' style='background-color: #ffffff; border: solid #ffffff 1.0pt; border-collapse: collapse;' width='420'><span style='font-size: 8.5pt; font-family: Arial,sans-serif; color: #444444;'>&nbsp;</span></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</table>
</body>
</html>

关于Outlook 的 HTML 忽略了我的固定表格尺寸(即使在浏览器中),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54418213/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com