Skip to main content

SetTableCellMarginRight

Specifies an amount of space which will be left between the right extent of the cell contents and the right border of all table cells within the parent table (or table row).

Inherited from ApiTablePr.SetTableCellMarginRight.

Syntax​

expression.SetTableCellMarginRight(nValue);

expression - A variable that represents an ApiTable class.

Parameters​

NameRequired/OptionalData typeDefaultDescription
nValueRequiredtwipsThe value for the amount of space to the right extent of the cell measured in twentieths of a point (1/1440 of an inch).

Returns​

boolean

Example​

Set the spacing between cell content and the right edge of every cell in a table in a document.

// How do I add breathing room to the right of the text inside every table cell in a document?

// Push cell content away from the right border of each cell in a table in a document.

let doc = Api.GetDocument();
let paragraph = doc.GetElement(0);
let tableStyle = doc.CreateStyle("CustomTableStyle", "table");
tableStyle.SetBasedOn(doc.GetStyle("Bordered"));
let table = Api.CreateTable(3, 3);
table.SetWidth("percent", 100);
table.SetStyle(tableStyle);
let cell = table.GetCell(0, 0).GetContent().GetElement(0).AddText("This is just a sample text to show that the right cell margin is 36 points.");
table.SetTableCellMarginRight(720);
doc.Push(table);