title: OpenXML SDK having borders for cell
body: <p>I have the following code that adds a cell with values and data-type for that cell in OpenXML SDK:   </p>
  
  <pre><code>Cell cell = InsertCellInWorksheet(column, row, worksheetPart);              
  cell.CellValue = new CellValue(index.ToString());
  cell.DataType = new EnumValue&lt;CellValues&gt;(CellValues.SharedString);
  </code></pre>
  
  <p>For this cell, how do I add a border on each side? I also like to add a background color on the cell as well.</p>
  
  <p>I have the following but not sure how to add the border to the cell:</p>
  
  <pre><code>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);
  </code></pre>
  
  <p>Thanks in advance</p>