The Table module provides an API for working with tables.
var quill = new DevExpress.Quill('#editor', {
modules: {
table: true
}
});
Adds a table to the selection range.
Methods
insertTable(rows: number, columns: number)
Examples
quill.setSelection(5);
quill.table.insertTable(2, 2);
Adds a header row to the thead
element.
Methods
insertHeaderRow()
Examples
quill.table.insertHeaderRow();
Adds a row above or below the cursor's position. The position of the row depends on the offset
parameter value.
Methods
insertRow(offset: number)
Examples
quill.table.insertRow(1); // inserts a row below
quill.table.insertRow(0); // inserts a row above
quill.table.insertRow(-3); // inserts a row 3 rows above the current position
quill.table.insertRow(3); // inserts a row 2 rows below the current position
Adds a row above the cursor's position.
Methods
insertRowAbove()
Examples
quill.table.insertRowAbove();
Adds a row below the cursor's position.
Methods
insertRowBelow()
Examples
quill.table.insertRowBelow();
Adds a column to the left or right of the cursor's position. The position of the column depends on the offset
parameter value.
Methods
quill.table.insertColumn(1); // inserts a column to the right
quill.table.insertColumn(0); // inserts a column to the left
quill.table.insertColumn(-3); // inserts a column 3 columns before the current position
quill.table.insertColumn(3); // inserts a column 2 columns after the current position
Examples
quill.table.insertColumn();
Adds a column to the left of the cursor's position.
Methods
insertColumnLeft(offset: number)
Examples
quill.table.insertColumnLeft();
Adds a column to the right of the cursor's position.
Methods
insertColumnRight(offset: number)
Examples
quill.table.insertColumnRight();
Gets the specified range of the table.
Methods
getTable(range = this.quill.getSelection()): [table, row, cell, offset]
Examples
const currentTable = quill.getTable();
const tableBySpecificRange = quill.table.getTable({ index: 3, length: 0 });
Deletes the row at the selection range.
Methods
deleteRow()
Examples
quill.setSelection(4);
quill.table.deleteRow();
Deletes the column at the selection range.
Methods
deleteColumn()
Examples
quill.setSelection(4);
quill.table.deleteColumn();
Deletes the table at the selection range.
Methods
deleteTable()
Examples
quill.setSelection(4);
quill.table.deleteTable();