在Web浏览器不支持边框样式时导出类似的边框样式
Contents
[
Hide
]
可能的使用场景
微软Excel支持一些虚线边框,但Web浏览器不支持。当使用Aspose.Cells for Python via .NET将此类Excel文件转换为HTML时,这些边框会被移除。然而,Aspose.Cells for Python via .NET也支持用 HtmlSaveOptions.export_similar_border_style 属性显示此类边框。请将其值设为 true ,未支持的边框也会导出到HTML文件。
在Web浏览器不支持边框样式时导出相似的边框样式
下面的示例代码加载了包含一些不支持的边框的sample Excel file,如下面的截图所示。截图进一步说明了output HTML中 HtmlSaveOptions.export_similar_border_style 属性的影响。
示例代码
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.export_similar_border_style = True | |
# Save the excel file. | |
workbook.save("outputExportSimilarBorderStyle.html", saveOptions) |