How to Insert Tables in Blazor Markdown Editor Component
7 Oct 20251 minute to read
The Syncfusion® Blazor Markdown Editor provides built-in support for inserting tables, allowing users to create and customize tables effortlessly within the editor.
Steps to Enable Table Insertion
To enable the table insertion feature:
- Add the CreateTableoption to the toolbar items.
- Click the Table icon in the toolbar.
- Select the desired table configuration and insert it into the editor.
Default Table Structure
When a table is inserted, it includes:
- 2 rows and 2 columns
- A table header row
This default layout allows users to begin formatting and adding content immediately.
The following example demonstrates how to enable table insertion in the Syncfusion Blazor Markdown Editor.
@using Syncfusion.Blazor.RichTextEditor
<SfRichTextEditor EditorMode="EditorMode.Markdown" Height="340px" Placeholder="Type Something" Value="@MarkdownValue">
    <RichTextEditorToolbarSettings Items="@Tools" />
</SfRichTextEditor>
@code {
    
    private string MarkdownValue { get; set; } = @"In Rich Text Editor, you click the toolbar buttons to format the words and 
        the changes are visible immediately. Markdown is not like that. When you format the word in Markdown format, you need to add Markdown syntax to the word to indicate which words and phrases should look different from each other. Rich Text Editor supports markdown editing when the editorMode set as **markdown** and using both *keyboard interaction* and *toolbar action*, you can apply the formatting to text. You can add our own custom formation syntax for the Markdown formation, [sample link](https://ej2.syncfusion.com/home/). The third-party library <b>Marked</b> is used in this sample to convert markdown into HTML content.";
    private List<ToolbarItemModel> Tools = new List<ToolbarItemModel>()
    {
        new ToolbarItemModel() { Command = ToolbarCommand.CreateTable }
    };
}