Skip to main content

SetTextDirection

Specifies the direction of the text flow for this table cell.

Syntax

expression.SetTextDirection(sType);

expression - A variable that represents a ApiTableCell class.

Parameters

NameRequired/OptionalData typeDefaultDescription
sTypeRequired"lrtb" | "tbrl" | "btlr"The available types of the text direction in the table cell: <code>"lrtb"</code>\ - text direction left-to-right moving from top to bottom, <code>"tbrl"</code> - text direction top-to-bottom moving from right\ to left, <code>"btlr"</code> - text direction bottom-to-top moving from left to right.

Returns

This method doesn't return any data.

Example

This example specifies the direction of the text flow for this table cell.

let doc = Api.GetDocument();
let tableStyle = doc.CreateStyle("CustomTableStyle", "table");
tableStyle.SetBasedOn(doc.GetStyle("Bordered"));
let table = Api.CreateTable(3, 3);
table.SetWidth("percent", 100);
let tableRow = table.GetRow(0);
tableRow.SetHeight("atLeast", 1440);
let tableCellPr = tableStyle.GetTableCellPr();
tableCellPr.SetTextDirection("btlr");
let cell = table.GetRow(0).GetCell(0);
let paragraph = cell.GetContent().GetElement(0);
paragraph.AddText("btlr");
table.SetStyle(tableStyle);
doc.Push(table);