使用 CrossHideRight 在保存为 HTML 时隐藏重叠内容
Contents
[
Hide
]
可能的使用场景
将Excel文件保存为HTML时,可以为单元格字符串指定不同的交叉类型。默认情况下,Aspose.Cells for Python via .NET 按照Microsoft Excel的方式生成HTML,但若将交叉类型更改为 CROSS_HIDE_RIGHT,则会隐藏覆盖或重叠在单元格字符串右侧的所有字符串。
在保存为Html时使用CrossHideRight隐藏重叠内容
以下示例代码加载了sample Excel文件,并在设置HtmlSaveOptions.html_cross_string_type为CROSS_HIDE_RIGHT后将其另存为output HTML。屏幕截图解释了CROSS_HIDE_RIGHT 如何影响默认输出的HTML。
示例代码
This file contains hidden or 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
# Load the Sample Workbook | |
workbook = Workbook("Book.xlsx") | |
# Initialize HtmlSaveOptions | |
saveOptions = HtmlSaveOptions() | |
saveOptions.html_cross_string_type = HtmlCrossType.CROSS_HIDE_RIGHT | |
# Save the excel file. | |
workbook.save("outputHidingOverlaidContentWithCrossHideRightWhileSavingToHtml.html", saveOptions) |