识别自闭标签

Contents
[ ]

HTML 可以为空标签设置多种标签格式,例如 <td></td>要么 <td/>. Aspose.Cells 现在支持这两种格式,而之前它只支持 <td></td>像标签。可以通过将附加的示例 HTML 文件转换为 Excel 文件来测试此功能。示例HTML文件和输出Excel文件可以从以下链接下载进行测试。

sampleSelfClosingTags.html

outsampleSelfClosingTags.xlsx

示例代码

// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET
// Set Html load options and keep precision true
HtmlLoadOptions loadOptions = new HtmlLoadOptions(LoadFormat.Html);
// Load sample source file
Workbook wb = new Workbook(sourceDir + "sampleSelfClosingTags.html", loadOptions);
// Save the workbook
wb.Save(outputDir + "outsampleSelfClosingTags.xlsx");