将 Excel 转换为 HTML 时隐藏覆盖内容
Contents
[
Hide
]
将 Excel 转换为 HTML 时隐藏覆盖内容
当您将 Excel 文件保存为 HTML 时,您可以为单元格字符串指定不同的交叉类型。默认情况下,Aspose.Cells 根据 Microsoft Excel 生成 HTML,但是当您更改HtmlSaveOptions.HtmlCrossStringType到叉_隐藏_正确的然后它隐藏单元格右侧的所有字符串,这些字符串与单元格字符串重叠或重叠。
下面的示例代码加载示例 Excel 文件并将其保存到输出 HTML设置后HtmlSaveOptions.HtmlCrossStringType作为叉_隐藏_正确的.截图解释了如何叉_隐藏_正确的影响默认输出的输出 HTML。
示例代码
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
source_directory = "Examples/SampleFiles/SourceDirectory/" | |
output_directory = "Examples/SampleFiles/OutputDirectory/" | |
# Load the Sample Workbook | |
workbook = Workbook(source_directory + "sampleHidingOverlaidContentWithCrossHideRightWhileSavingToHtml.xlsx") | |
# Initialize HtmlSaveOptions | |
saveOptions = HtmlSaveOptions() | |
saveOptions.setHtmlCrossStringType(HtmlCrossType.CROSS_HIDE_RIGHT) | |
# Save the excel file. | |
workbook.save(output_directory + "outputHidingOverlaidContentWithCrossHideRightWhileSavingToHtml.html", saveOptions) |