Get Started
Documentation

GetPrevious

GetPrevious() → { ApiTableCell | null }

Get the previous cell.

Returns:

Type
ApiTableCell | null

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.SetWidth("percent", 100);
oTable.SetStyle(oTableStyle);
oTable.GetCell(0, 0).GetContent().GetElement(0).AddText("Cell 1");
oTable.GetCell(0, 1).GetContent().GetElement(0).AddText("Cell 2");
oDocument.Push(oTable);
oPreviousCell = oTable.GetCell(0, 1).GetPrevious();
oPreviousCell.GetContent().GetElement(0).SetBold(true);
builder.SaveFile("docx", "GetPrevious.docx");
builder.CloseFile();

Resulting document