使用 CrossHideRight 在保存为 HTML 时隐藏重叠内容
Contents
[
Hide
]
可能的使用场景
在保存Excel文件为HTML时,您可以为单元格字符串指定不同的交叉类型。 默认情况下,Aspose.Cells生成与Microsoft Excel相符的HTML,但当您将交叉类型更改为CrossHideRight时,则隐藏单元格右侧的所有与单元格字符串叠加或重叠的字符串。
在保存为Html时使用CrossHideRight隐藏重叠内容
以下示例代码加载了sample Excel文件,并在设置HtmlSaveOptions.HtmlCrossStringType为CrossHideRight后将其另存为output HTML。屏幕截图解释了CrossHideRight 如何影响默认输出的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-.NET | |
//Load sample Excel file | |
Workbook wb = new Workbook(sourceDir + "sampleHidingOverlaidContentWithCrossHideRightWhileSavingToHtml.xlsx"); | |
//Specify HtmlSaveOptions - Hide Overlaid Content with CrossHideRight while saving to Html | |
HtmlSaveOptions opts = new HtmlSaveOptions(); | |
opts.HtmlCrossStringType = HtmlCrossType.CrossHideRight; | |
//Save to HTML with HtmlSaveOptions | |
wb.Save(outputDir + "outputHidingOverlaidContentWithCrossHideRightWhileSavingToHtml.html", opts); |