HI,
Is it possible to change the styling of a table within a word document and have the font change ?
I've noticed that within WORD itself, changing a table style does not change the actual font or its size. Does Spire.Doc give you this ability?
Table table = sec.Tables[0] as Table;
table.ApplyStyle(DefaultTableStyle.MediumShading1Accent2);
ParagraphStyle style = new ParagraphStyle(doc);
style.Name = "MyStyle";
//font name
style.CharacterFormat.FontName = "Arial";
//font size
style.CharacterFormat.FontSize = 14;
doc.Styles.Add(style);
Table table = sec.Tables[0] as Table;
for (int i = 0; i < table.Rows.Count; i++)
{
for (int j = 0; j < table.Rows[i].Cells.Count; j++)
{
TableCell cell = table.Rows[i].Cells[j];
foreach (Paragraph para in cell.Paragraphs)
{
//apply style
para.ApplyStyle(style.Name);
}
}
}