Add some bottom margin to WTable

Hello,

I'm working with WTable in a WordDocument object and I'm trying to add some blank space after the table (so the next content is not sticked to the table bottom border), but the only way I found is to add an extra empty paragraph to the section where the WTable is (after the table) in this way:


 {
    var section = document.LastSection;
    RenderTable(document, section); //Render the table to this section
    section.AddParagraph();//Add some space after the table
}


I cannot understand how to add margin without using a new paragraph... is there a way to achieve it?
Thank you.


1 Reply

LB Lokesh Baskar Syncfusion Team March 16, 2022 06:06 PM UTC

Hi Rocco,

If your requirement is to add some blank space after the table means, we suggest you add the empty paragraph after the table or you can add the required spacing before and after for the paragraph content which is inserted after the table. So that after the table we can get more or less spacing. Please refer to the below highlighted code snippet. 
WordDocument document = new WordDocument("Table.docx"); 
var section = document.LastSection; 
RenderTable(document, section); //Render the table to this section 
IWParagraph paragraph = section.AddParagraph(); 
paragraph.ParagraphFormat.AfterSpacing = 20; 
paragraph.ParagraphFormat.BeforeSpacing = 20; 

Please refer to the below UG documentation link to know more
https://help.syncfusion.com/file-formats/docio/working-with-tables#applying-cell-formatting


Regards, 
Lokesh B 


Loader.
Up arrow icon