Skip to main content

Remove

Removes the current table row.

Syntax

expression.Remove();

expression - A variable that represents a ApiTableRow class.

Parameters

This method doesn't have any parameters.

Returns

boolean

Example

Delete a row from a table in a document.

// How do I permanently remove an unwanted row from a table in a document?

// Eliminate a specific row to shorten or clean up a table 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.SetStyle(tableStyle);
let row = table.GetRow(0);
row.GetCell(0).GetContent().GetElement(0).AddText("First row");
row.Remove();
doc.Push(table);