All docs
V20.2
20.2
20.1
The page you are viewing does not exist in version 20.1. This link will take you to the root page.
19.2
The page you are viewing does not exist in version 19.2. This link will take you to the root page.
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.

Table

Create a table at the certain position

Related members: activeSubDocument, active, tables, create(position, columnCount, rowCount),

var columnCount = 5;
var rowCount = 5;
var subDocument = richEdit.selection.activeSubDocument;
var position = richEdit.selection.active;
var table = subDocument.tables.create(position, columnCount, rowCount);

Create a table at the specified position and populate it with content

Related members: create(position, columnCount, rowCount), beginUpdate, beginTransaction, activeSubDocument, active, tables, rows, cells, insertText(position, text)

richEdit.beginUpdate();
richEdit.history.beginTransaction();
var subDocument = richEdit.selection.activeSubDocument;
var position = richEdit.selection.active;
var columnCount = 5;
var rowCount = 5;
var table = subDocument.tables.create(position, columnCount, rowCount);
for (var rowInd = 0, row; row = table.rows.getByIndex(rowInd); rowInd++) {
    for (var cellInd = 0, cell; cell = row.cells.getByIndex(cellInd); cellInd++) {
        subDocument.insertText(cell.interval.start, "Row[" + rowInd + "].Cell[" + cellInd + "]");
    }
}
richEdit.history.endTransaction();
richEdit.endUpdate();