当 Web 浏览器不支持边框样式时导出类似的边框样式
Contents
[
Hide
]
可能的使用场景
Microsoft Excel 支持 Web 浏览器不支持的某些类型的虚线边框。当您使用 Aspose.Cells 将此类 Excel 文件转换为 HTML 时,将删除此类边框。但是,Aspose.Cells也可以支持显示这样的边框HtmlSaveOptions.ExportSimilarBorderStyle财产。请将其值设置为真的并且不支持的边框也将导出到 HTML 文件。
当 Web 浏览器不支持边框样式时导出类似的边框样式
下面的示例代码加载示例 Excel 文件包含一些不受支持的边框,如以下屏幕截图所示。截图进一步说明了效果HtmlSaveOptions.ExportSimilarBorderStyle里面的财产输出 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 the sample Excel file | |
Workbook wb = new Workbook("sampleExportSimilarBorderStyle.xlsx"); | |
//Specify Html Save Options - Export Similar Border Style | |
HtmlSaveOptions opts = new HtmlSaveOptions(); | |
opts.ExportSimilarBorderStyle = true; | |
//Save the workbook in Html format with specified Html Save Options | |
wb.Save("outputExportSimilarBorderStyle.html", opts); |