NPOI 边框样式在 macOS / iOS 预览中显示不同
NPOI border styles appear differently in macOS / iOS Preview
以下款式
var style1 = (XSSFCellStyle)workbook.CreateCellStyle();
var pink = new XSSFColor(new byte[] { 228, 52, 145 });
style1.SetBorderColor(BorderSide.TOP, pink);
style1.BorderTop = BorderStyle.Medium;
在 Excel
中正确呈现
但不在 macOS 中/iOS 预览
如何使边框显示正确?
最后,在所有地方应用边框解决了 macOS / iOS 预览中的问题。我补充说:
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;
以下款式
var style1 = (XSSFCellStyle)workbook.CreateCellStyle();
var pink = new XSSFColor(new byte[] { 228, 52, 145 });
style1.SetBorderColor(BorderSide.TOP, pink);
style1.BorderTop = BorderStyle.Medium;
在 Excel
中正确呈现但不在 macOS 中/iOS 预览
如何使边框显示正确?
最后,在所有地方应用边框解决了 macOS / iOS 预览中的问题。我补充说:
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;