Skip to main content

GetContent

Returns the current cell content.

Syntax

expression.GetContent();

expression - A variable that represents a ApiTableCell class.

Parameters

This method doesn't have any parameters.

Returns

ApiDocumentContent

Example

Access the text content stored inside a table cell in a document.

// How do I read the content from a table cell in a document?

// Extract what is written inside a table cell in a document.

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 cell = table.GetRow(0).GetCell(0);
cell.GetContent().GetElement(0).AddText("Cell #1");
table.SetStyle(tableStyle);
doc.Push(table);