【发布时间】:2014-10-04 08:29:41
【问题描述】:
我试图得到这个输出:
<thead>
<tr><th>Condition</th><th>Effective Dates</th><th>Condition Status</th></tr>
</thead>
但我得到了这个:
<thead>
<tr>
<th>DX Code</th>
<th>Date</th>
<th>Code Type</th>
</tr>
</thead>
我似乎无法让元素显示在一行上。 我的代码是:
doc.WriteStartElement("thead");
doc.WriteStartElement("tr");
doc.WriteStartElement("th");
doc.WriteString("DX Code");
doc.WriteEndElement();
doc.WriteStartElement("th");
doc.WriteString("Date");
doc.WriteEndElement();
doc.WriteStartElement("th");
doc.WriteString("Code Type");
doc.WriteEndElement();
doc.WriteEndElement();
doc.WriteEndElement();
有没有办法像第一个示例一样获取格式?我尝试使用 WriteString,但它用 XML '<' 和 '>' 替换了所有的 ""
【问题讨论】:
标签: c# html-table xmlwriter