在Web浏览器不支持边框样式时导出类似的边框样式

可能的使用场景

Microsoft Excel支持一些类型的虚线边框,而Web浏览器不支持。当您使用Aspose.Cells将这样的Excel文件转换为HTML时,这样的边框将被移除。然而,Aspose.Cells也可以支持显示类似的边框,只需将 HtmlSaveOptions.ExportSimilarBorderStyle 属性的值设置为 true 即可。不支持的边框也将导出到HTML文件中。

在Web浏览器不支持边框样式时导出相似的边框样式

以下示例代码加载包含一些不受支持的边框的sample Excel file ,如下屏幕截图所示。屏幕截图进一步说明了HtmlSaveOptions.ExportSimilarBorderStyle属性对output HTML的影响。

todo:image_alt_text

示例代码

// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Java
//Load the sample Excel file
Workbook wb = new Workbook("sampleExportSimilarBorderStyle.xlsx");
//Specify Html Save Options - Export Similar Border Style
HtmlSaveOptions opts = new HtmlSaveOptions();
opts.setExportSimilarBorderStyle(true);
//Save the workbook in Html format with specified Html Save Options
wb.save("outputExportSimilarBorderStyle.html", opts);