Skip to main content

SetPaddings

Sets the table paddings. If table is inline, then only left padding is applied.

Syntax

expression.SetPaddings(nLeft, nTop, nRight, nBottom);

expression - A variable that represents a ApiTable class.

Parameters

NameRequired/OptionalData typeDefaultDescription
nLeftRequiredNumberLeft padding.
nTopRequiredNumberTop padding.
nRightRequiredNumberRight padding.
nBottomRequiredNumberBottom padding.

Returns

boolean

Example

This example sets the table paddings.

let doc = Api.GetDocument();
let tableStyle = doc.CreateStyle("CustomTableStyle", "table");
tableStyle.SetBasedOn(doc.GetStyle("Bordered"));
let table = Api.CreateTable(3, 3);
table.SetStyle(tableStyle);
doc.Push(table);
table.GetCell(0, 0).GetContent().GetElement(0).AddText("This is just a sample text.");
table.SetPaddings(10, 10, 5, 5);