【发布时间】:2012-02-09 20:16:28
【问题描述】:
我刚刚发现了这封 html 电子邮件,现在我需要对其进行样式设置,以便我可以在我的桌子上的这两列之间留出一个空格这是我的代码:
var html = new XDocument(
new XElement("html",
new XElement("body",
new XElement("h2", "Your entire inventory:"),
new XElement("table",
new XElement("tr",
new XElement("th", "Product"),
new XElement("th", "Quantity")),
new XElement("tr",
from item in prodList
select new XElement("td", item.ProductName, new XElement("td", item.Quantity), new XElement("tr")))
))));
这是我得到的输出:
Your entire inventory:
Product Quantity
Nissin rich & savory chicken bw - 6 pack 5
The Zombie Survival Guide 3
Maruchan Ramen Noodle Soup 5
Generic Tomatoes, Whole 2
所以我需要弄清楚如何在标签中添加样式以获取电子邮件中的填充/边框等
【问题讨论】:
-
我当然希望您得到的输出是 XML 而不是您发布的文本。如果没有,为什么要使用
XDocument? -
我将数据从 mysql 获取到 html 电子邮件的最后一个问题将我带到了那里。这是我的最后一个问题。 stackoverflow.com/questions/9167208/…