New to Telerik UI for ASP.NET MVC? Download free 30-day trial

Table Editing

The Editor exposes the capability of editing a data table as any other (X)HTML. The options that the table editing provides are:

To enable the table editing, you should add the TableEditing tool to the widget's configuration:

    @(Html.Kendo().Editor()
      .Name("editor")
      .HtmlAttributes(new { style = "height:440px", aria_label = "editor" })
      .Tools(tools => tools.TableEditing())
    )


## Inserting a Table

To insert a new table by using the Table Wizard dialog:

1. Click on the `Create Table` tool.
1. To open the dialog, click the `Table Wizard` button.
1. Configure the table that is to be inserted.
1. Click the `OK` button.

To quickly create a plain table, click on the `Create Table` tool and choose the row and column dimensions. 

## Editing a Table

To modify an existing table or a table cell:

1. Select the table or the table cell to edit.
1. Click the Table Wizard tool in the toolbar.

> You can resize the table rows and columns by dragging the cell border with the mouse and without using the Table Wizard dialog.

The table and cell options that are available in the **Table Wizard** are displayed in the following three tabs:

* [**Table**](#table-tab)—The available options for the table element.
* [**Cell**](#cell-tab)—The available options for the selected cell or all cells in the table.
* [**Accessibility**](#accessibility-tab)—The available options related to accessibility.

## Available Options

### Table Tab

The **Table** tab provides the following options:

* **Width**—Changes the width of the table (in pixels, em, or percent).
* **Height**—Changes the height of the table (in pixels, em, or percent).
* **Columns**—Defines the columns of the table.
* **Rows**—Defines the rows of the table.
* **Cell Spacing**—Specifies the space between the cells ([`cellspacing` attribute](http://www.w3schools.com/tags/att_table_cellspacing.asp)).
* **Cell Padding**—Specifies the padding in the cells ([`cellpadding` attribute](http://www.w3schools.com/tags/att_table_cellpadding.asp)).
* **Alignment**—Specifies the text alignment in the cells.
* **Background**—Specifies the background color of the table.
* **CSS Class**—Defines the class names for the table element (white space-separated).
* **ID**—Defines the id of the table element.
* **Border**—Defines the border size (in pixels only) and color.
* **Border Style**—Defines the border style (`none`, `hidden`, `dotted`, `dashed`, `solid`, `double`, `groove`, `ridge`, `inset`, `outset`, `initial`, and `inherit`).
* **Collapse borders**—Adds an inline style to that table element with the `border-collapse: collapse` rule ([`border-collapse` property](http://www.w3schools.com/cssref/pr_border-collapse.asp)).

### Cell Tab

The **Cell** tab provides the following options:

* **Select All Cells**—Applies the changes to all cells in the table.
* **Width**—Changes the width of the cell or cells (in pixels, em, or percent).
* **Height**—Changes the height of the cell or cells (in pixels, em, or percent).
* **Cell Margin**—Defines the margin of the cell or cells.
* **Cell Padding**—Defines the padding of the cell or cells.
* **Alignment**—Specifies the text alignment of the cell or cells.
* **Background**—Specifies the background color of the cell or cells.
* **CSS Class**—Defines class names for the cells (white space-separated).
* **ID**—Defines the id of the cells.
* **Border**—Defines the border size (in pixels only) and color of the cells.
* **Border Style**—Defines the border style (`none`, `hidden`, `dotted`, `dashed`, `solid`, `double`, `groove`, `ridge`, `inset`, `outset`, `initial`, and `inherit`).
* **Wrap text**—When unchecked, applies a `white-space: nowrap` style to the cells ([`white-space` property](http://www.w3schools.com/cssref/pr_text_white-space.asp)).

### Accessibility Tab

The **Accessibility** tab provides the following options:

* **Header Rows**&mdash;Allows the user to specify the number of rows in the table that should belong to header and should render `<th>` cell elements instead of `<td>`. When creating a new Table, those rows will be placed within a `<thead>` element.
* **Header Cols**&mdash;Allows the user to specify the number of columns in the table that would be headers for their respective rows. The cells will be rendered as `<th>` elements instead of `<td>`.
* **Caption**&mdash;Adds a [`caption` element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/caption) for the table with the respective text.
* **Alignment**&mdash;Defines the text alignment of the caption.
* **Summary**&mdash;Adds a [`summary` attribute](http://www.w3schools.com/tags/att_table_summary.asp) to the table using value defined. The `summary` attribute has been deprecated in HTML5 and its use should be avoided when possible.
* **Associate headers**&mdash;Allows the user to specify the mode in which content cells should be associated with their header cells. it provides the following three options:
    * **None** - Will not explicitly associate cells. That is the default option and it is appropriate for tables with simple structure (no merged cells).
    * **Associate using 'scope' attribute** - The wizard will add the appropriate [`scope` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/th) to all header cells.
    * **Associate using Ids** - The wizard will assign IDs to all header cells and will inject [`headers` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/td) with the appropriate value to all data (and header, if needed) cells.

## See Also

* [Table Editing of the Editor HtmlHelper for ASP.NET MVC (Demo)](https://demos.telerik.com/aspnet-mvc/editor/table-editing)
* [Server-Side API](/api/editor)
In this article