Hi!
I tried two different things.
My first approach: a spacer paragraph (not a spacer row):
Code:
Table t1 = section.AddTable();
t1.AddColumn(Unit.FromCentimeter(15));
var row1 = t1.AddRow();
t1.Borders.Width = 0.5;
var para = section.AddParagraph();
para.Format.LineSpacingRule = LineSpacingRule.Exactly;
para.Format.LineSpacing = "0.2cm";
para.Format.SpaceBefore = 0;
para.Format.SpaceAfter = 0;
Table t2 = section.AddTable();
t2.AddColumn(Unit.FromCentimeter(12));
var row2 = t2.AddRow();
t2.Borders.Width = 0.5;
Setting the height of the spacer row worked for me only after adding a paragraph:
Code:
Table t1 = section.AddTable();
t1.AddColumn(Unit.FromCentimeter(15));
var row1 = t1.AddRow();
t1.Borders.Width = 0.5;
var spacerRow = t1.AddRow();
spacerRow.Height = "0.2cm";
var para2 = new Paragraph();
para2.Format.LineSpacingRule = LineSpacingRule.Exactly;
para2.Format.LineSpacing = "0.2cm";
para2.Format.SpaceBefore = 0;
para2.Format.SpaceAfter = 0;
spacerRow.Cells[0].Add(para2);
Table t2 = section.AddTable();
t2.AddColumn(Unit.FromCentimeter(12));
var row2 = t2.AddRow();
t2.Borders.Width = 0.5;
My table only has a single column and it worked after adding a paragraph to that column. It could be that this trick requires such spacer paragraphs in all columns. Could be a bug.
Setting the spacer row to a height of "2cm" does work, but "2mm" does not work (it seems it uses the height of a text line by default even though there is no text in that row).
Two solutions, which one is better? The spacer row - you can set "row1.KeepWith = 1;" for the row preceding the spacer row to prevent having the spacer row as the first row on a new page after a page break (currently you cannot prevent this with a spacer paragraph between two tables).
BTW: When exporting to RTF you will need a paragraph between the two tables. This can be a paragraph with a height of 0.