Get Started
Documentation

SetPaddings

SetPaddings(nLeft, nTop, nRight, nBottom) → { bool }

Sets table paddings. If table is inline -> only left padding applies.

Parameters:

Name Type Description
nLeft Number
nTop Number
nRight Number
nBottom Number

Returns:

Type
bool

Example

Copy code
builder.CreateFile("docx");
oDocument = Api.GetDocument();
oTableStyle = oDocument.CreateStyle("CustomTableStyle", "table");
oTableStyle.SetBasedOn(oDocument.GetStyle("Bordered - Accent 5"));
oTable = Api.CreateTable(3, 3);
oTable.SetStyle(oTableStyle);
oDocument.Push(oTable);
oTable.GetCell(0, 0).GetContent().GetElement(0).AddText("This is just a sample text.");
oTable.SetPaddings(10, 10, 5, 5);
builder.SaveFile("docx", "SetPaddings.docx");
builder.CloseFile();

Resulting document