OpenXML SDK でそのセルの値とデータ型を持つセルを追加する次のコードがあります。
Cell cell = InsertCellInWorksheet(column, row, worksheetPart);
cell.CellValue = new CellValue(index.ToString());
cell.DataType = new EnumValue<CellValues>(CellValues.SharedString);
このセルの各辺に境界線を追加するにはどうすればよいですか? また、セルに背景色を追加することも好きです。
私は次のものを持っていますが、セルに境界線を追加する方法がわかりません:
Borders borders1 = new Borders() { Count = (UInt32Value)1U };
Border border1 = new Border();
LeftBorder leftBorder1 = new LeftBorder();
RightBorder rightBorder1 = new RightBorder();
TopBorder topBorder1 = new TopBorder();
BottomBorder bottomBorder1 = new BottomBorder();
border1.Append(leftBorder1);
border1.Append(rightBorder1);
border1.Append(topBorder1);
border1.Append(bottomBorder1);
borders1.Append(border1);
前もって感謝します