0 results found

table

Contribute to this page

This plugin adds table management functionality to TinyMCE.

Table controls/buttons

NameSummary
tablecontrolsAll table control below and some separators between them.
tableInsert table control.
row_propsEdit row properties (tr).
cell_propsEdit cell properties (td).
delete_colDelete column control.
delete_rowDelete row control.
delete_tableDelete table control.
col_afterColumn after control.
col_beforeColumn before control.
row_afterRow after control.
row_beforeRow before control.
split_cellsSplits a merged cell into rows and columns.
merge_cellsMergers selected cells into one cell.

Table commands to use with execCommand

NameSummary
mceInsertTableInserts a new table at cursor location the default size is 2x2. If the value parameter is specified it should contain a name/value array, this array has the following options cols, rows, border, cellspacing, cellpadding. The default border is set to: 0.
mceTableInsertRowBeforeInserts a row before/above the current cursor location.
mceTableInsertRowAfterInserts a row after/under the current cursor location.
mceTableDeleteRowDeletes the row at the current cursor location.
mceTableInsertColBeforeInserts a column before the current cursor location.
mceTableInsertColAfterInserts a column after the current cursor location.
mceTableDeleteColDeletes the column at the current cursor location.
mceTableDeleteDeletes the table at the current cursor location.

Plugin options

NameSummary
table_stylesThis option should contain a semicolon separated list of class titles and class names separated by =. The titles are the ones that get presented to the user in the styles drop down list and and the class names is the classes that gets inserted.
table_cell_stylesThis option should contain a semicolon separated list of class titles and class names separated by =. The titles are the ones that get presented to the user in the styles drop down list and and the class names is the classes that gets inserted.
table_row_stylesThis option should contain a semicolon separated list of class titles and class names separated by =. The titles are the ones that get presented to the user in the styles drop down list and and the class names is the classes that gets inserted.
table_cell_limitEnables you to specify the max number of cells for a table.
table_row_limitEnables you to specify the max number of rows for a table.
table_col_limitEnables you to specify the max number of columns for a table.
table_default_borderEnables you to specify the default border value.
table_default_cellpaddingEnables you to specify the default cellpadding value.
table_default_cellspacingEnables you to specify the default cellspacing value.

Installation Instructions

  1. Add plugin to TinyMCE plugin option list example: plugins : "table".
  2. Add the table button names to button list, example: theme_advanced_buttons3_add : "tablecontrols".

Initialization Example

tinyMCE.init({
  theme : "advanced",
  mode : "textareas",
  plugins : "table",
  theme_advanced_buttons3_add : "tablecontrols",
  table_styles : "Header 1=header1;Header 2=header2;Header 3=header3",
  table_cell_styles : "Header 1=header1;Header 2=header2;Header 3=header3;Table Cell=tableCel1",
  table_row_styles : "Header 1=header1;Header 2=header2;Header 3=header3;Table Row=tableRow1",
  table_cell_limit : 100,
  table_row_limit : 5,
  table_col_limit : 5
});

Except as otherwise noted, the content of this page is licensed under the Creative Commons BY-NC-SA 3.0 License, and code samples are licensed under the Apache 2.0 License.