This project has moved and is read-only. For the latest updates, please go here.

Formatting a Paragraph (inside a table) with SpaceBefore and SpaceAfter

Oct 30, 2015 at 11:38 PM
Edited Nov 3, 2015 at 3:02 AM
I'm adding a paragraph inside of a table cell and I'm trying to apply a styling of SpaceBefore of 0 and a SpaceAfter of 0.

This doesn't work:
CurrentRow.Cells[0].Paragraphs[0].InsertParagraphAfterSelf("my text", false, fmt).SpacingBefore(0).SpacingAfter(0);
My table is defined as:
t.Design = TableDesign.None;
Anyone know how to do this?


No matter what I specify in SpacingBefore and SpacingAfter, I always open the document to 3pt before and 6pt after.

Those calls don't seem to do anything at all. Am I using them incorrectly?

Or, how can I specify No Space Between Paragraphs Of Same Style?
Nov 5, 2015 at 4:03 AM
I worked around this issue by creating a custom table template and saving it in the document.

Then, after I create the table, I used:
t.CustomTableDesignName = "mytabledesign";
That fixed the problem.