table/utils
@ckeditor/ckeditor5-table/src/utils
Filtering
Functions
-
getSelectedTableCells( selection ) → Array.<Element>
static
Returns all model table cells that are fully selected (from the outside) within the provided model selection's ranges.
To obtain the cells selected from the inside, use
getTableCellsContainingSelection
.Parameters
selection : Selection
Returns
Array.<Element>
-
getSelectedTableWidget( selection ) → Element | null
static
Returns a table widget editing view element if one is selected.
-
getSelectionAffectedTableCells( selection ) → Array.<Element>
static
Returns all model table cells that are either completely selected by selection ranges or host selection range start positions inside them.
Combines
getTableCellsContainingSelection
andgetSelectedTableCells
.Parameters
selection : Selection
Returns
Array.<Element>
-
getTableCellsContainingSelection( selection ) → Array.<Element>
static
Returns all model table cells that the provided model selection's ranges
start
inside.To obtain the cells selected from the outside, use
getSelectedTableCells
.Parameters
selection : Selection
Returns
Array.<Element>
-
getTableWidgetAncestor( selection ) → Element | null
static
Returns a table widget editing view element if one is among the selection's ancestors.
-
isTableWidget( viewElement ) → Boolean
static
Checks if a given view element is a table widget.
-
toTableWidget( viewElement, writer, label ) → Element
static
Converts a given
Element
to a table widget:- Adds a custom property allowing to recognize the table widget element.
- Calls the
toWidget
function with the proper element's label creator.
Parameters
viewElement : Element
writer : DowncastWriter
An instance of the view writer.
label : String
The element's label. It will be concatenated with the table
alt
attribute if one is present.
Returns