请问怎么把html格式的表格信息写入到docx
能否给我一个代码实例????
@hhh1111 例如
doc = aw.Document()
builder = aw.DocumentBuilder(doc)
html = ("<table border=\"1\" style=\"border-collapse: collapse;\">"
"<thead>"
"<tr>"
"<th>S.N</th>"
"<th>Item</th>"
"<th>Quantity</th>"
"</tr>"
"</thead>"
"<tr>"
"<td rowspan=\"3\">Mark Smith</td>"
"<td>English</td>"
"<td>67</td>"
"</tr>"
"<tr>"
"<td>Maths</td>"
"<td>82</td>"
"</tr>"
"<tr>"
"<td>Science</td>"
"<td>91</td>"
"</tr>"
"<tr>"
"<td colspan=\"2\">Total</td>"
"<td>5</td>"
"</tr>"
"</table>")
builder.insert_html(html)
如果某些地方没有示例,可以查看 .NET 文档。或者您也可以查看公开示例。Aspose.Words-for-Python-via-.NET/Examples/ApiExamples at master · aspose-words/Aspose.Words-for-Python-via-.NET · GitHub