将Excel转换为带有标题的HTML
Contents
[
Hide
]
将 Excel 转换为带有标题的 HTML
Aspose.Cells for Python via NET 在将 Excel 转换为 HTML 时提供了导出标题的选项。为此,您可以将 HtmlSaveOptions.export_row_column_headings 属性设置为 true。 HtmlSaveOptions.export_row_column_headings 属性的默认值为 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
from aspose.cells import HtmlSaveOptions, Workbook | |
# For complete examples and data files, please go to https:# github.com/aspose-cells/Aspose.Cells-for-.NET | |
# Load sample source file | |
workbook = Workbook(sourceDir + "Book1.xlsx") | |
options = HtmlSaveOptions() | |
options.export_row_column_headings = True | |
# Save the workbook | |
workbook.save(outputDir + "PrintHeadings_out.html", options) |