答案 0 :(得分:2)
针对您的具体问题,我会遍历每一行中的单元格,直到找到需要边框的单元格,然后应用格式:(注意DesiredCell是为您添加单元格引用检查)
foreach(Row row in sheetData.Elements<Row>)
{
foreach(Cell cell in row.Elements<Cell>)
{
if(cell.CellReference == DesiredCell)
{
cell = new Cell(new CellValue(“ ”)) { DataType = CellValues.String, StyleIndex = 1 };
}
}
}
您还必须从上面的链接添加样式索引。