Skip to content

Latest commit

 

History

History
224 lines (141 loc) · 2.98 KB

table.md

File metadata and controls

224 lines (141 loc) · 2.98 KB

The Table module provides an API for working with tables.

Configuration

var quill = new DevExpress.Quill('#editor', {
  modules: {
    table: true
  }
});

API

insertTable

Adds a table to the selection range.

Methods

insertTable(rows: number, columns: number)

Examples

quill.setSelection(5);
quill.table.insertTable(2, 2);

insertHeaderRow

Adds a header row to the thead element.

Methods

insertHeaderRow()

Examples

quill.table.insertHeaderRow();

insertRow

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

insertRowAbove

Adds a row above the cursor's position.

Methods

insertRowAbove()

Examples

quill.table.insertRowAbove();

insertRowBelow

Adds a row below the cursor's position.

Methods

insertRowBelow()

Examples

quill.table.insertRowBelow();

insertColumn

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();

insertColumnLeft

Adds a column to the left of the cursor's position.

Methods

insertColumnLeft(offset: number)

Examples

quill.table.insertColumnLeft();

insertColumnRight

Adds a column to the right of the cursor's position.

Methods

insertColumnRight(offset: number)

Examples

quill.table.insertColumnRight();

getTable

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 });

deleteRow

Deletes the row at the selection range.

Methods

deleteRow()

Examples

quill.setSelection(4);
quill.table.deleteRow();

deleteColumn

Deletes the column at the selection range.

Methods

deleteColumn()

Examples

quill.setSelection(4);
quill.table.deleteColumn();

deleteTable

Deletes the table at the selection range.

Methods

deleteTable()

Examples

quill.setSelection(4);
quill.table.deleteTable();