TableRow tr1 = new TableRow(); TableCell tc11 = new TableCell(); TableCellProperties tcp = new TableCellProperties(); GridSpan gridSpan = new GridSpan(); gridSpan.Val = 11; Paragraph p11 = new Paragraph(); ParagraphProperties pp11 = new ParagraphProperties(); pp11.Justification = new Justification() { Val = JustificationValues.Center }; Run r11 = new Run(); RunProperties rp11 = new RunProperties(); rp11.Bold = new Bold(); r11.Append(rp11); r11.Append(new Text(""+"My text")); p11.Append(r11); tcp.Append(gridSpan); tc11.Append(tcp); tc11.Append(p11); tr1.Append(tc11); table1.Append(tr1);
// Create the TableCellProperties object TableCellProperties tcp = new TableCellProperties( new TableCellWidth { Type = TableWidthUnitValues.Auto, } ); // Create the Shading object DocumentFormat.OpenXml.Wordprocessing.Shading shading = new DocumentFormat.OpenXml.Wordprocessing.Shading() { Color = "auto", Fill = "ABCDEF", Val = ShadingPatternValues.Clear }; // Add the Shading object to the TableCellProperties object tcp.Append(shading); // Add the TableCellProperties object to the TableCell object tc.Append(tcp);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)