I am generating word doc from HTML content using Microsoft.Office.Interop.Word dll. Word doc file is generated properly. but I am getting much padding space issue. I have two tables and I want to give a minimum space between two tables. I have tried to apply padding and margin on the table but both are not working. If I place an extra line then it is showing much space between two tables.
Is there any way to give minimum space between tables?
Result if we add a line between two tables.
Result if we do not place the extra line between two tables.
Word requires a paragraph (not a "line") between two tables in order for them to be separate tables. If there is none, as in the second screen shot in the question, then Word regards them as a single table. This may or may not be a problem for the document in question, but should be understood.
\n
or \r
) needs to come between them. The
paragraph mark is not just a character code - behind the scenes it
stores important formatting information, including positioning of the
table on the page.If the paragraph mark between the tables is too "tall" there are various formatting possibilities that can be applied to reduce this:
Properly, especially if this multi-table content format is used more than once, the formatting attributes should be set in a paragraph style. Then using them is a simple matter of applying the style to the paragraph.