将Excel转换为带有标题的HTML
Contents
[
Hide
]
将 Excel 转换为带有标题的 HTML
Aspose.Cells 提供了在将 Excel 转换为 HTML 时导出标题的选项。 为此,您可以将 HtmlSaveOptions.ExportHeadings 属性设置为 true。 HtmlSaveOptions.ExportHeadings 属性的默认值为 false。 以下图像显示了以下代码生成的输出文件。
示例代码
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET | |
//Load sample source file | |
Workbook workbook = new Workbook(sourceDir + "Book1.xlsx"); | |
HtmlSaveOptions options = new HtmlSaveOptions(); | |
options.ExportRowColumnHeadings = true; | |
// Save the workbook | |
workbook.Save(outputDir + "PrintHeadings_out.html", options); |