Skip to main content

Table

Plugin alias: table

editor42.init({
plugins: 'table'
});

Provides comprehensive table editing capabilities including table/row/column/cell insertion, deletion, merging, splitting, cut/copy/paste of rows and columns, and property dialogs for tables, rows, and cells. Registers a large collection of toolbar buttons, menu items, a context toolbar, and a context menu for right-click table operations.

Options

OptionTypeDefaultDescription
table_border_widthsobject[]1px–5pxBorder width options.
table_border_stylesobject[]10 styles (solid, dotted, dashed, double, etc.)Border style options.
table_cell_advtabbooleantrueShow advanced tab in cell dialog.
table_row_advtabbooleantrueShow advanced tab in row dialog.
table_advtabbooleantrueShow advanced tab in table dialog.
table_appearance_optionsbooleantrueShow appearance options.
table_gridbooleantrue (false on touch)Show grid picker for insertion.
table_cell_class_listobject[][]Cell CSS classes.
table_row_class_listobject[][]Row CSS classes.
table_class_listobject[][]Table CSS classes.
table_toolbarstring'tableprops tabledelete | tableinsertrowbefore tableinsertrowafter tabledeleterow | tableinsertcolbefore tableinsertcolafter tabledeletecol'Context toolbar items.
table_background_color_mapobject[][]Cell background color map.
table_border_color_mapobject[][]Cell border color map.
table_style_by_cssbooleantrueWhen true, cell spacing and padding are applied as CSS styles; when false, as HTML attributes.
table_merge_content_on_pastebooleantrueWhen true, pasting a table into an existing table merges content into cells rather than nesting tables.

Commands

CommandDescription
editor42TablePropsTable properties dialog.
editor42TableRowPropsRow properties dialog.
editor42TableCellPropsCell properties dialog.
editor42InsertTableDialogNew table dialog.

Toolbar buttons

ButtonType
tableMenu button
tablepropsButton
tabledeleteButton
tablecellpropsButton
tablemergecellsButton
tablesplitcellsButton
tableinsertrowbeforeButton
tableinsertrowafterButton
tabledeleterowButton
tablerowpropsButton
tableinsertcolbeforeButton
tableinsertcolafterButton
tabledeletecolButton
tablecutrowButton
tablecopyrowButton
tablepasterowbeforeButton
tablepasterowafterButton
tablecutcolButton
tablecopycolButton
tablepastecolbeforeButton
tablepastecolafterButton
tableinsertdialogButton
tablecaptionToggle button
tablerowheaderToggle button
tablecolheaderToggle button
tableclassMenu button (conditional)
tablecellclassMenu button (conditional)
tablecellvalignMenu button
tablecellborderwidthMenu button
tablecellborderstyleMenu button
tablecellbackgroundcolorMenu button
tablecellbordercolorMenu button
ItemType
inserttableMenu item
tablepropsMenu item
deletetableMenu item
tableinsertrowbeforeMenu item
tableinsertrowafterMenu item
tabledeleterowMenu item
tablerowpropsMenu item
tablecutrowMenu item
tablecopyrowMenu item
tablepasterowbeforeMenu item
tablepasterowafterMenu item
tableinsertcolumnbeforeMenu item
tableinsertcolumnafterMenu item
tabledeletecolumnMenu item
tablecutcolumnMenu item
tablecopycolumnMenu item
tablepastecolumnbeforeMenu item
tablepastecolumnafterMenu item
tablecellpropsMenu item
tablemergecellsMenu item
tablesplitcellsMenu item
rowNested menu
columnNested menu
cellNested menu
inserttabledialogMenu item
tableclassNested menu item (conditional)
tablecellclassNested menu item (conditional)
tablecellvalignNested menu item
tablecellborderwidthNested menu item
tablecellborderstyleNested menu item
tablecellbackgroundcolorNested menu item
tablecellbordercolorNested menu item
tablecaptionToggle menu item
tablerowheaderToggle menu item
tablecolheaderToggle menu item

Events

EventDescription
NewRowFired when a new row is created.
NewCellFired when a new cell is created.
TableModifiedFired when a table is modified. Payload: { table, structure, style }.