var trg = new TableRowGroup();
for (int r = 0; r < 5; r++)
{
var tr = new TableRow();
for (int c = 0; c < 5; c++)
{
var sf = string.Format("{0}x{1}", r, c);
var run = new Run(sf);
var par = new Paragraph(run);
var td = new TableCell();
td.Blocks.Add(par);
tr.Cells.Add(td);
}
trg.Rows.Add(tr);
}
var t = new Table();
t.RowGroups.Add(trg);
rich.Selection.Text = "";
var pt = rich.Selection.Start.InsertParagraphBreak();
rich.Document.Blocks.InsertBefore(pt.Paragraph, t);