# Table

> Editor42 Table plugin — provides comprehensive table editing capabilities including insertion, deletion, merging, splitting, and property dialogs.

Source: https://editor42.com/plugins/table  
Every page of editor42.com has a Markdown copy at its URL + `.md` (`index.md` after a URL that ends in `/`); all of them are in one file: https://editor42.com/llms-full.txt

Plugin alias: `table`

```js
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

| Option | Type | Default | Description |
|---|---|---|---|
| `table_border_widths` | object[] | 1px–5px | Border width options. |
| `table_border_styles` | object[] | 10 styles (solid, dotted, dashed, double, etc.) | Border style options. |
| `table_cell_advtab` | boolean | `true` | Show advanced tab in cell dialog. |
| `table_row_advtab` | boolean | `true` | Show advanced tab in row dialog. |
| `table_advtab` | boolean | `true` | Show advanced tab in table dialog. |
| `table_appearance_options` | boolean | `true` | Show appearance options. |
| `table_grid` | boolean | `true` (`false` on touch) | Show grid picker for insertion. |
| `table_cell_class_list` | object[] | `[]` | Cell CSS classes. |
| `table_row_class_list` | object[] | `[]` | Row CSS classes. |
| `table_class_list` | object[] | `[]` | Table CSS classes. |
| `table_toolbar` | string | `tableprops tabledelete \| tableinsertrowbefore tableinsertrowafter tabledeleterow \| tableinsertcolbefore tableinsertcolafter tabledeletecol` | Context toolbar items. |
| `table_background_color_map` | object[] | `[]` | Cell background color map. |
| `table_border_color_map` | object[] | `[]` | Cell border color map. |
| `table_style_by_css` | boolean | `true` | When `true`, cell spacing and padding are applied as CSS styles; when `false`, as HTML attributes. |
| `table_merge_content_on_paste` | boolean | `true` | When `true`, pasting a table into an existing table merges content into cells rather than nesting tables. |

## Commands

| Command | Description |
|---|---|
| `editor42TableProps` | Table properties dialog. |
| `editor42TableRowProps` | Row properties dialog. |
| `editor42TableCellProps` | Cell properties dialog. |
| `editor42InsertTableDialog` | New table dialog. |

## Toolbar buttons

| Button | Type |
|---|---|
| `table` | Menu button |
| `tableprops` | Button |
| `tabledelete` | Button |
| `tablecellprops` | Button |
| `tablemergecells` | Button |
| `tablesplitcells` | Button |
| `tableinsertrowbefore` | Button |
| `tableinsertrowafter` | Button |
| `tabledeleterow` | Button |
| `tablerowprops` | Button |
| `tableinsertcolbefore` | Button |
| `tableinsertcolafter` | Button |
| `tabledeletecol` | Button |
| `tablecutrow` | Button |
| `tablecopyrow` | Button |
| `tablepasterowbefore` | Button |
| `tablepasterowafter` | Button |
| `tablecutcol` | Button |
| `tablecopycol` | Button |
| `tablepastecolbefore` | Button |
| `tablepastecolafter` | Button |
| `tableinsertdialog` | Button |
| `tablecaption` | Toggle button |
| `tablerowheader` | Toggle button |
| `tablecolheader` | Toggle button |
| `tableclass` | Menu button (conditional) |
| `tablecellclass` | Menu button (conditional) |
| `tablecellvalign` | Menu button |
| `tablecellborderwidth` | Menu button |
| `tablecellborderstyle` | Menu button |
| `tablecellbackgroundcolor` | Menu button |
| `tablecellbordercolor` | Menu button |

## Menu items

| Item | Type |
|---|---|
| `inserttable` | Menu item |
| `tableprops` | Menu item |
| `deletetable` | Menu item |
| `tableinsertrowbefore` | Menu item |
| `tableinsertrowafter` | Menu item |
| `tabledeleterow` | Menu item |
| `tablerowprops` | Menu item |
| `tablecutrow` | Menu item |
| `tablecopyrow` | Menu item |
| `tablepasterowbefore` | Menu item |
| `tablepasterowafter` | Menu item |
| `tableinsertcolumnbefore` | Menu item |
| `tableinsertcolumnafter` | Menu item |
| `tabledeletecolumn` | Menu item |
| `tablecutcolumn` | Menu item |
| `tablecopycolumn` | Menu item |
| `tablepastecolumnbefore` | Menu item |
| `tablepastecolumnafter` | Menu item |
| `tablecellprops` | Menu item |
| `tablemergecells` | Menu item |
| `tablesplitcells` | Menu item |
| `row` | Nested menu |
| `column` | Nested menu |
| `cell` | Nested menu |
| `inserttabledialog` | Menu item |
| `tableclass` | Nested menu item (conditional) |
| `tablecellclass` | Nested menu item (conditional) |
| `tablecellvalign` | Nested menu item |
| `tablecellborderwidth` | Nested menu item |
| `tablecellborderstyle` | Nested menu item |
| `tablecellbackgroundcolor` | Nested menu item |
| `tablecellbordercolor` | Nested menu item |
| `tablecaption` | Toggle menu item |
| `tablerowheader` | Toggle menu item |
| `tablecolheader` | Toggle menu item |

## Events

| Event | Description |
|---|---|
| `NewRow` | Fired when a new row is created. |
| `NewCell` | Fired when a new cell is created. |
| `TableModified` | Fired when a table is modified. Payload: `{ table, structure, style }`. |
