NPOI边框样式在macOS / iOS Preview中显示不同

时间:2018-05-31 02:37:43

标签: npoi

以下风格

var style1 = (XSSFCellStyle)workbook.CreateCellStyle();
var pink = new XSSFColor(new byte[] { 228, 52, 145 });
style1.SetBorderColor(BorderSide.TOP, pink);
style1.BorderTop = BorderStyle.Medium;

在Excel中正确呈现

enter image description here

但不是在macOS / iOS预览中

enter image description here

如何让边框正确显示?

1 个答案:

答案 0 :(得分:0)

最后,在各处应用边框修复了macOS / iOS Preview中的问题。我补充说:

var grayColor = new XSSFColor(new byte[] { 210, 210, 223 });
style1.SetBorderColor(BorderSide.RIGHT, grayColor);
style1.BorderRight = BorderStyle.Thin;
style1.SetBorderColor(BorderSide.LEFT, grayColor);
style1.BorderLeft = BorderStyle.Thin;
style1.SetBorderColor(BorderSide.BOTTOM, grayColor);
style1.BorderBottom = BorderStyle.Thin;