在保存到 HTML 时使用 CrossHideRight 隐藏覆盖内容
Contents
[
Hide
]
可能的使用场景
当您将 Excel 文件保存为 HTML 时,您可以为单元格字符串指定不同的交叉类型。默认情况下,Aspose.Cells 根据 Microsoft Excel 生成 HTML,但是当您更改HtmlSaveOptions.HtmlCrossStringType到CROSS_HIDE_RIGHT然后它隐藏单元格右侧的所有字符串,这些字符串与单元格字符串重叠或重叠。
在保存到 HTML 时使用 CrossHideRight 隐藏覆盖内容
下面的示例代码加载示例 Excel 文件并将其保存到输出 HTML设置后HtmlSaveOptions.HtmlCrossStringType作为CROSS_HIDE_RIGHT.截图解释了如何CROSS_HIDE_RIGHT影响默认输出的输出 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
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Java | |
//Load sample Excel file | |
Workbook wb = new Workbook(srcDir + "sampleHidingOverlaidContentWithCrossHideRightWhileSavingToHtml.xlsx"); | |
//Specify HtmlSaveOptions - Hide Overlaid Content with CrossHideRight while saving to Html | |
HtmlSaveOptions opts = new HtmlSaveOptions(); | |
opts.setHtmlCrossStringType(HtmlCrossType.CROSS_HIDE_RIGHT); | |
//Save to HTML with HtmlSaveOptions | |
wb.save(outDir + "outputHidingOverlaidContentWithCrossHideRightWhileSavingToHtml.html", opts); |