goog.editor.Table
Provided By |
---|
Class providing high level table editing functions.
new Table( node )
Parameters |
|
---|
Instance Methods
this.createEmptyTd() → Element
Element
Creates an empty TD element and fill it with some empty content so it will show up with borders even in IE pre-7 or if empty-cells is set to 'hide'
Parameters | None. | ||
---|---|---|---|
Returns |
|
this.insertCellElement( td, rowIndex, colIndex ) → void
void
Inserts a cell element at the given position. The colIndex is the logical column index, not the position in the dom. This takes into consideration that cells in a given logical row may actually be children of a previous DOM row that have used rowSpan to extend into the row.
Parameters |
|
---|
this.insertColumn( opt_colIndex ) → Array<(Element|null)>
Array<(Element|null)>
Inserts a new column in the table. The column will be created by inserting new TD elements in each row, or extending the colspan of existing TD elements.
Parameters |
| ||||
---|---|---|---|---|---|
Returns |
|
this.insertRow( opt_rowIndex ) → Element
Element
Inserts a new row in the table. The row will be populated with new cells, and existing rowspanned cells that overlap the new row will be extended.
Parameters |
| ||||
---|---|---|---|---|---|
Returns |
|
this.mergeCells( startRowIndex, startColIndex, endRowIndex, endColIndex ) → boolean
boolean
Merges multiple cells into a single cell, and sets the rowSpan and colSpan attributes of the cell to take up the same space as the original cells.
Parameters |
| ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
this.refresh() → void
void
Walks the dom structure of this object's table element and populates this.rows with goog.editor.TableRow objects. This is done initially to populate the internal data structures, and also after each time the DOM structure is modified. Currently this means that the all existing information is discarded and re-read from the DOM.
this.removeColumn( colIndex ) → void
void
Removes a column from the table. This is done by removing cell elements, or shrinking the colspan of elements that span multiple columns.
Parameters |
|
---|
this.removeRow( rowIndex ) → void
void
Removes a row from the table, removing the TR element and decrementing the rowspan of any cells in other rows that overlap the row.
Parameters |
|
---|
this.splitCell( rowIndex, colIndex ) → Array<(Element|null)>
Array<(Element|null)>
Instance Properties
this.dom_ → goog.dom.DomHelper
goog.dom.DomHelper
No information.
this.element → (HTMLTableElement|null)
(HTMLTableElement|null)
No information.
this.rows → Array<goog.editor.TableRow>
Array<goog.editor.TableRow>
No information.
Static Functions
Table.createDomTable( doc, columns, rows, opt_tableStyle ) → Element
Element
Creates a new table element, populated with cells and formatted.
Parameters |
| ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
Table.getChildCellElements( tr ) → Array<(Element|null)>
Array<(Element|null)>
Returns all child elements of a TR element that are of type TD or TH.
Parameters |
| ||||
---|---|---|---|---|---|
Returns |
|
Static Properties
Table.DEFAULT_BORDER_COLOR → string
string
Default color for table borders.
Table.OPTIMUM_EMPTY_CELL_WIDTH → number
number
Optimum size of empty cells (in pixels), if possible.
Table.OPTIMUM_MAX_NEW_TABLE_WIDTH → number
number
Maximum width for new tables.