public void AddParagraph(string text) { var paragraph = new Paragraph(); var run = new Run { RunProperties = new RunProperties() }; DocumentBuilderHelpers.AddTextToElement(run, text); paragraph.AppendChild(run); _body.AppendChild(paragraph); }
public void AddTableRow(List <string> cellData) { var tableRow = new TableRow(); cellData.ForEach(cellText => { var tableCell = new TableCell(); var paragraph = new Paragraph(); var run = new Run(); DocumentBuilderHelpers.AddTextToElement(run, cellText); paragraph.AppendChild(run); tableCell.AppendChild(paragraph); tableRow.AppendChild(tableCell); }); _table.AppendChild(tableRow); }