Bes*_*nna 6 .net c# vb.net epplus
但是我遗漏了一些细节,因为下面的代码写在一行上并且没有扩展单元格的高度.到目前为止,这是我的代码:
ws.Cells[$"A{row}:F{row}"].Merge = true;
ws.Cells[$"A{row}"].Style.WrapText = true;
ws.SelectedRange[$"A{row}"].Value = purchaseHistory[0].LineText;
Run Code Online (Sandbox Code Playgroud)
要将合并的单元格垂直和水平居中,只需执行以下操作:
//Only need to grab the first cell of the merged range
ws.Cells[$"A{row}"].Style.VerticalAlignment = ExcelVerticalAlignment.Center;
ws.Cells[$"A{row}"].Style.HorizontalAlignment = ExcelHorizontalAlignment.Center;
Run Code Online (Sandbox Code Playgroud)
如果您需要对行的高度执行某些操作,则需要查看该CustomHeight设置.这应该解释一下: 在EPPlus中自动调整行
| 归档时间: |
|
| 查看次数: |
14826 次 |
| 最近记录: |