The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
VSVijayakumar S Syncfusion Team March 15, 2010 07:11 PM UTC
Hi Adi,
Thank you for using Syncfusion products.
Please do find the code snippet to set the cell margin for a table/table cell.
WordDocument wordDoc = new WordDocument(); wordDoc.EnsureMinimal(); IWTable table = wordDoc.LastSection.AddTable(); RowFormat format = new RowFormat();
//This line sets cell margin for all the cells as 4f (for left, right, top and bottom margins) format.Paddings.All = 4f;
table.ResetCells(2, 2, format, 200);
for (int rowIndex = 0; rowIndex < 2; rowIndex++) { for (int colIndex = 0; colIndex < 2; colIndex++) { WTableCell cell = table.Rows[rowIndex].Cells[colIndex]; //This line Defines whether to use same paddings as table has. cell.CellFormat.SamePaddingsAsTable = false;
cell.CellFormat.Paddings.Left = 5.4f; //in terms of points cell.CellFormat.Paddings.Right = 5.4f;//in terms of points cell.CellFormat.Paddings.Top = 0;//in terms of points cell.CellFormat.Paddings.Bottom = 0;//in terms of points } }