public static XWPFParagraph SetCellText(XWPFDocument doc, XWPFTable table, WordCell wordCell) { CT_P para = new CT_P(); XWPFParagraph pCell = new XWPFParagraph(para, table.Body); pCell.Alignment = wordCell.H_Alignment; pCell.VerticalAlignment = wordCell.V_Alignment; XWPFRun r1c1 = pCell.CreateRun(); r1c1.SetText(wordCell.Content); r1c1.FontSize = wordCell.FontSize; r1c1.FontFamily = wordCell.FontFamily; r1c1.IsBold = wordCell.FontBold; return(pCell); }
public List <WordCell> AddRow() { if (this.Rows == null) { Rows = new List <List <WordCell> >(); } var newRow = new List <WordCell>(); for (var i = 0; i < ColumnCount; i++) { var newCell = new WordCell(); newRow.Add(newCell); } Rows.Add(newRow); return(newRow); }