使用 CrossHideRight 在保存为 HTML 时隐藏重叠内容
Contents
[
Hide
]
可能的使用场景
将 Excel 文件保存为 HTML 时,您可以为单元格字符串指定不同的交叉类型。Aspose.Cells 默认按照 Microsoft Excel 生成 HTML,但当将HtmlSaveOptions.HtmlCrossStringType更改为CROSS_HIDE_RIGHT时,它会隐藏与单元格字符串重叠或重叠的右侧的所有字符串。
在保存为 HTML 时隐藏重叠的内容与 CrossHideRight
以下示例代码加载sample Excel file并在将HtmlSaveOptions.HtmlCrossStringType设置为CROSS_HIDE_RIGHT后将其保存为output HTML。屏幕截图说明了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); |