API model used to edit cells in a table.
The HTML String passed as an argument is added as a child at the back of the Element.
var cell = editor.getAPIModelById('id'); cell.append('<span>TEXT</span>'); |
The HTML String passed as an argument is added as a child to the front of the Element.
var cell = editor.getAPIModelById('id'); cell.prepend('<span>TEXT</span>'); |
Delete a column that contains cells.
var cell = editor.getAPIModelById('id'); cell.deleteCol(); |
Delete the row containing the cell.
var cell = editor.getAPIModelById('id'); cell.deleteRow(); |
Add a column after the cell. If the before value is true, a column is added to the front of the cell.
var cell = editor.getAPIModelById('id'); cell.insertCol(); // add column after cell cell.insertCol(true); // add column before cell |
Add a row after the cell. If the before value is true, a row is added before the cell.
var cell = editor.getAPIModelById('id'); cell.insertRow(); // add row after cell cell.insertRow(true); // add row before cell |
Sets the width of the column containing the cell.
var cell = editor.getAPIModelById('id'); cell.setColWidth(200); cell.setColWidth(20, '%'); |
Sets the height of the row containing the cell.
var cell = editor.getAPIModelById('id'); cell.setRowHeight(50); |
Set the HTML string value passed as an argument to the cell's internal HTML.
var cell = editor.getAPIModelById('id'); cell.setHTML('<p><span>Add HTML. All previously entered information will be erased.</span></p>'); |
Set the text string value passed as an argument to the internal Text of the cell.
var cell = editor.getAPIModelById('id'); cell.setText('Sample text.'); |
Splits a cell into a specified number of columns and rows. There may be restrictions when splitting merged cells.
var cell = editor.getAPIModelById('id'); cell.splitCell(2,2); |