table/tablecolumnresize/utils
@ckeditor/ckeditor5-table/src/tablecolumnresize/utils
Filtering
Functions
-
clamp( number, min, max ) → Number
module:table/tablecolumnresize/utils~clamp
Clamps the number within the inclusive lower (min) and upper (max) bounds. Returned number is rounded using the
toPrecision()
function.Parameters
number : Number
min : Number
max : Number
Returns
Number
-
fillArray( length, value ) → Array.<*>
module:table/tablecolumnresize/utils~fillArray
Creates an array with defined length and fills all elements with defined value.
Parameters
length : Number
value : *
Returns
Array.<*>
-
getAffectedTables( changes, model ) → Set.<Element>
module:table/tablecolumnresize/utils~getAffectedTables
Collects all affected by the differ table model elements. The returned set may be empty.
-
getColumnIndex( cell ) → Object
module:table/tablecolumnresize/utils~getColumnIndex
Returns the column indexes on the left and right edges of a cell.
-
getColumnMinWidthAsPercentage( table, editor ) → Number
module:table/tablecolumnresize/utils~getColumnMinWidthAsPercentage
Calculates the percentage of the minimum column width given in pixels for a given table.
-
getColumnWidthsInPixels( table, editor ) → Array.<Number>
module:table/tablecolumnresize/utils~getColumnWidthsInPixels
Calculates the column widths in pixels basing on the
columnWidths
table attribute: -
getElementWidthInPixels( domElement ) → Number
module:table/tablecolumnresize/utils~getElementWidthInPixels
Returns the computed width (in pixels) of the DOM element.
Parameters
domElement : HTMLElement
Returns
Number
-
getNumberOfColumn( table, editor ) → Number
module:table/tablecolumnresize/utils~getNumberOfColumn
Returns the total number of columns in a table.
-
getTableWidthInPixels( table, editor ) → Number
module:table/tablecolumnresize/utils~getTableWidthInPixels
Calculates the table width in pixels.
-
isTableRendered( table, editor ) → Number
module:table/tablecolumnresize/utils~isTableRendered
Checks if the table is already fully rendered, with the
<colgroup>
element that defines the widths for each column. -
normalizeColumnWidthsAttribute( columnWidthsAttribute ) → Array.<Number>
module:table/tablecolumnresize/utils~normalizeColumnWidthsAttribute
Makes sure that the sum of the widths from all columns is 100%. If the sum of all the widths is not equal 100%, all the widths are changed proportionally so that they all sum back to 100%.
Currently, only widths provided as percentage values are supported.
Parameters
columnWidthsAttribute : String
Returns
Array.<Number>
-
sumArray( array ) → Number
module:table/tablecolumnresize/utils~sumArray
Sums all array values that can be parsed to a float.
Parameters
array : Array.<Number>
Returns
Number
-
toPrecision( value ) → Number
module:table/tablecolumnresize/utils~toPrecision
Rounds the provided value to a fixed-point number with defined number of digits after the decimal point.
Parameters
value : Number | String
Returns
Number
Every day, we work hard to keep our documentation complete. Have you spotted an outdated information? Is something missing? Please report it via our issue tracker.