NotesForHtmlToOpenXML 表行跨度 &列跨度问题
将 HTML 文件转换为 OpenXML 格式
我正在使用 NotesForHtmlToOpenXML (http://notesforhtml2openxml.codeplex.com) 原始表格图像
当我将上表的 HTML 转换为 docx 格式时,输出如下。
下面是原始表格的 HTML 代码。
<table id="tbl-pg-2-13-5" class="table-main" border="1" cellspacing="1" cellpadding="1">
<tbody>
<tr id="pg-2-14">
<td id="pg-2-15" class="table-td" valign="top" rowspan="2" colspan="2">
</td>
<td id="pg-2-16" class="table-td" valign="top" colspan="2">
<p id="pg-2-17" class="table-textstyle2">
<i>Consideration of use</i>
</p>
</td>
</tr>
<tr id="pg-2-19">
<td id="pg-2-20" class="table-td" valign="top">
<p id="pg-2-21" class="table-textstyle2">
<i>Low</i>
</p>
</td>
<td id="pg-2-23" class="table-td" valign="top">
<p id="pg-2-24" class="table-textstyle2">
<i>High</i>
</p>
</td>
</tr>
<tr id="pg-2-26">
<td id="pg-2-27" class="table-td" rowspan="2" valign="top">
<p id="pg-2-28" class="table-textstyle2">
<i>Quest for fundamental understanding</i>
</p>
</td>
<td id="pg-2-30" class="table-td" valign="top">
<p id="pg-2-31" class="table-textstyle2">
<i>High</i>
</p>
</td>
<td id="pg-2-33" class="table-td" valign="top">
<p id="pg-2-61" class="table-textstyle0">
1. Pure basic research (Bohr)
</p>
</td>
<td id="pg-2-38" class="table-td" valign="top">
<p id="pg-2-62" class="table-textstyle0">
2. Use-inspired basic research (Pasteur)
</p>
</td>
</tr>
<tr id="pg-2-45">
<td id="pg-2-46" class="table-td" valign="top">
<p id="pg-2-47" class="table-textstyle2">
<i>Low</i> 
</p>
</td>
<td id="pg-2-49" class="table-td" valign="top">
<p id="pg-2-63" class="table-textstyle0">
3.
</p>
</td>
<td id="pg-2-52" class="table-td" valign="top">
<p id="pg-2-64" class="table-textstyle0">
4. Pure applied research (Edison)
</p>
</td>
</tr>
</tbody>
</table>
请提供将上述 HTML 正确转换为 OpenXML 的解决方案。
I am converting a HTML file to OpenXML format using NotesForHtmlToOpenXML (http://notesforhtml2openxml.codeplex.com)
When I convert the above table's HTML to docx format, the output is given below.
Given below is the HTML code of the original table.
<table id="tbl-pg-2-13-5" class="table-main" border="1" cellspacing="1" cellpadding="1">
<tbody>
<tr id="pg-2-14">
<td id="pg-2-15" class="table-td" valign="top" rowspan="2" colspan="2">
</td>
<td id="pg-2-16" class="table-td" valign="top" colspan="2">
<p id="pg-2-17" class="table-textstyle2">
<i>Consideration of use</i>
</p>
</td>
</tr>
<tr id="pg-2-19">
<td id="pg-2-20" class="table-td" valign="top">
<p id="pg-2-21" class="table-textstyle2">
<i>Low</i>
</p>
</td>
<td id="pg-2-23" class="table-td" valign="top">
<p id="pg-2-24" class="table-textstyle2">
<i>High</i>
</p>
</td>
</tr>
<tr id="pg-2-26">
<td id="pg-2-27" class="table-td" rowspan="2" valign="top">
<p id="pg-2-28" class="table-textstyle2">
<i>Quest for fundamental understanding</i>
</p>
</td>
<td id="pg-2-30" class="table-td" valign="top">
<p id="pg-2-31" class="table-textstyle2">
<i>High</i>
</p>
</td>
<td id="pg-2-33" class="table-td" valign="top">
<p id="pg-2-61" class="table-textstyle0">
1. Pure basic research (Bohr)
</p>
</td>
<td id="pg-2-38" class="table-td" valign="top">
<p id="pg-2-62" class="table-textstyle0">
2. Use-inspired basic research (Pasteur)
</p>
</td>
</tr>
<tr id="pg-2-45">
<td id="pg-2-46" class="table-td" valign="top">
<p id="pg-2-47" class="table-textstyle2">
<i>Low</i>
</p>
</td>
<td id="pg-2-49" class="table-td" valign="top">
<p id="pg-2-63" class="table-textstyle0">
3.
</p>
</td>
<td id="pg-2-52" class="table-td" valign="top">
<p id="pg-2-64" class="table-textstyle0">
4. Pure applied research (Edison)
</p>
</td>
</tr>
</tbody>
</table>
Please provide solution to convert the above HTML to OpenXML correctly.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我能够使用下面显示的代码(AltChunk & AlternateFormatImportPart)进行导入。这里的finalDocument 是WordprocessingDocument 类型。
“”;
I was able to import using code(AltChunk & AlternateFormatImportPart) displayed below. Here finalDocument is of type WordprocessingDocument.
"";