Table Editing

The React Editor component, part of KendoReact, allows you to configure the table and cell properties and change the design of a table by using the Table properties tool and the Cell properties tool.

To resize the table rows and columns, you can also drag the cell border by using the mouse.

Table Properties Tool

The Table properties dialog organizes the available table editing options into two tabs: General and Advanced.

General Table Properties

The General tab lists the options for the table element:

OptionDescription
WidthChanges the width of the table.
HeightChanges the height of the table.
ColumnsDefines the columns of the table.
RowsDefines the rows of the table.
Cell spacingSpecifies the space between the cells (the border-spacing property).
Cell paddingSpecifies the padding in the cells.
AlignmentSpecifies the text alignment in the cells.
BackgroundSpecifies the background color of the table.
Border widthDefines the border size in pixels.
Border colorDefines the border color.
Border styleDefines the border style (None, Hidden, Dotted, Dashed, Solid, Double, Groove, Ridge, Inset, Outset, Initial, and Inherit).
Collapse bordersAdds an inline style to the table and applies the border-collapse: collapse rule (the border-collapse property).

Advanced Table Properties

The Advanced tab lists the CSS class, ID, and the table options related to accessibility:

OptionDescription
CSS classDefines the class names for the table element (white space-separated).
IDDefines the id of the table element.
CaptionAdds a caption element for the table with the respective text.
Caption sidePlaces the caption element for the table оn a specified side (the caption-side property).
AlignmentDefines the text alignment of the caption.
Header rowsAllows the user to specify the number of rows in the table that belong to the header and must render <th> instead of <td> cell elements. When creating a new table, those rows will be placed within a <thead> element.
Header colsAllows the user to specify the number of columns in the table that are headers for their respective rows. The cells will be rendered as <th> instead of <td> elements.
Associate headers
Allows the user to specify the mode in which content cells will be associated with their header cells. The following modes are available:

None—Does not explicitly associate cells. This is the default option and it is appropriate for tables with simple structure (no merged cells).

Using 'scope' attribute—Adds the appropriate scope attribute to all header cells.

Using 'id' attributes—Assigns IDs to all header cells and injects header attributes with the appropriate value into all data cells (and header cells, if needed).

Cell Properties Tool

The Cell properties dialog lists the options available for the selected cell or for all cells in the table.

OptionDescription
Apply to all cellsApplies the changes to all cells in the table.
WidthChanges the width of the cell or cells.
HeightChanges the height of the cell or cells.
AlignmentSpecifies the text alignment of the cell or cells.
Text controlWhen you select Fit to cell, the Editor control applies a white-space: nowrap style to the cells (the white-space property).
Cell paddingDefines the padding of the cell or cells.
BackgroundSpecifies the background color of the cell or cells.
Border widthDefines the border size of the cells in pixels.
Border colorDefines the color of the cells.
Border styleDefines the border style (None, Hidden, Dotted, Dashed, Solid, Double, Groove, Ridge, Inset, Outset, Initial, and Inherit).
IDDefines the id of the cells.
CSS classDefines the class names for the cells (white space-separated).

The following example demonstrates the table and cell properties tools in action:

Example
View Source
Change Theme: