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

可能的使用场景

Microsoft Excel 支持某些网页浏览器不支持的虚线边框类型。当您使用 Aspose.Cells 将此类 Excel 文件转换为 HTML 时,此类边框会被删除。然而,Aspose.Cells 也支持使用 HtmlSaveOptions.ExportSimilarBorderStyle 属性来显示此类边框。请将其值设置为 true,不支持的边框将被导出到 HTML 文件。

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

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

todo:image_alt_text

示例代码

// 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);