这个方法能解决:SetEnclosedBorderOfRegion()

 

1 //merged cells on mutiple rows
2             CellRangeAddress region = new CellRangeAddress(2, 4, 0, 0);
3             sheet.AddMergedRegion(region);
4 
5             //set enclosed border for the merged region
6             ((HSSFSheet)sheet).SetEnclosedBorderOfRegion(region, BorderStyle.DOTTED, NPOI.HSSF.Util.HSSFColor.RED.index);

注意:如果新建行,边框会初始化。

 

参考:https://q.cnblogs.com/q/42580/

 

相关文章:

  • 2021-07-06
  • 2021-12-05
  • 2021-08-23
  • 2021-05-25
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-09-20
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-17
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案