syncfusion/blazor-ui-components-skills / skills/syncfusion-blazor-rich-text-editor
syncfusion-blazor-rich-text-editor
VerifiedImplements the Syncfusion Blazor Rich Text Editor (SfRichTextEditor) from Syncfusion.Blazor.RichTextEditor. Supports HTML, Markdown, and IFrame editor modes. Use this skills for toolbar configuration, image/video/audio insertion, table management, paste cleanup, import/export Word/PDF, accessibility, globalization, RTL, and inline or custom toolbar tool scenarios in Blazor applications.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 11.1 KB |
| references/accessibility-globalization.md | markdown | 6.7 KB |
| references/built-in-tools.md | markdown | 6.7 KB |
| references/custom-tools.md | markdown | 9.1 KB |
| references/data-binding.md | markdown | 4.6 KB |
| references/editor-modes.md | markdown | 5.8 KB |
| references/events.md | markdown | 23.6 KB |
| references/getting-started.md | markdown | 4.9 KB |
| references/images-and-media.md | markdown | 7.2 KB |
| references/import-export.md | markdown | 8.1 KB |
| references/inline-mode.md | markdown | 4.3 KB |
| references/methods.md | markdown | 10.3 KB |
| references/paste-and-cleanup.md | markdown | 6.7 KB |
| references/properties.md | markdown | 12.2 KB |
| references/tables.md | markdown | 8.1 KB |
| references/text-formatting.md | markdown | 7.0 KB |
| references/toolbar.md | markdown | 6.9 KB |
references/tables.md
View on GitHub# Tables
## Table of Contents
- [Inserting a Table](#inserting-a-table)
- [Table Settings Properties](#table-settings-properties)
- [Table Quick Toolbar](#table-quick-toolbar)
- [TableToolbarCommand Enum Reference](#tabletoolbarcommand-enum-reference)
- [Row and Column Selection](#row-and-column-selection)
- [Merge and Split Cells](#merge-and-split-cells)
- [Custom Table Styles](#custom-table-styles)
---
## Inserting a Table
Add `ToolbarCommand.CreateTable` to the toolbar. Users then click/drag on a grid to select rows and columns (or type numbers in the popup dialog on touch devices):
```razor
<SfRichTextEditor>
<RichTextEditorToolbarSettings Items="@Tools" />
</SfRichTextEditor>
@code {
private List<ToolbarItemModel> Tools = new()
{
new() { Command = ToolbarCommand.Bold },
new() { Command = ToolbarCommand.Italic },
new() { Command = ToolbarCommand.Separator },
new() { Command = ToolbarCommand.CreateTable },
new() { Command = ToolbarCommand.Separator },
new() { Command = ToolbarCommand.Undo },
new() { Command = ToolbarCommand.Redo }
};
}
```
---
## Table Settings Properties
Use `RichTextEditorTableSettings` to control default table behaviour:
| Property | Type | Default | Description |
|---|---|---|---|
| `Width` | `string` | `"100%"` | Default table width on insert |
| `MinWidth` | `double` | `0` | Minimum table width |
| `MaxWidth` | `double?` | `null` | Maximum table width |
| `EnableResize` | `bool` | `true` | Allow resizing columns by dragging |
| `Styles` | `List<DropDownItemModel>` | Built-in | Border/style presets shown in quick toolbar |
```razor
<SfRichTextEditor>
<RichTextEditorTableSettings Width="80%" MinWidth="200" EnableResize="true" />
</SfRichTextEditor>
```
---
## Table Quick Toolbar
Configure which actions appear when a table is selected. Include `TableToolbarCommand.TableCell` to expose merge/split:
```razor
<SfRichTextEditor>
<RichTextEditorToolbarSettings Items="@Tools" />
<RichTextEditorQuickToolbarSettings Table="@TableTools" />
</SfRichTextEditor>
@code {
private List<ToolbarItemModel> Tools = new()
{
new() { Command = ToolbarCommand.CreateTable }
};
private List<TableToolbarItemModel> TableTools = new()
{
new() { Command = TableToolbarCommand.TableHeader },
new() { Command = TableToolbarCommand.TableRemove },
new() { Command = TableToolbarCommand.Separator },
new() { Command = TableToolbarCommand.TableRows },
new() { Command = TableToolbarCommand.TableColumns },
new() { Command = TableToolbarCommand.TableCell }, // enables merge/split
new() { Command = TableToolbarCommand.Separator },
new() { Command = TableToolbarCommand.Styles },
new() { Command = TableToolbarCommand.BackgroundColor },
new() { Command = TableToolbarCommand.Alignments },
new() { Command = TableToolbarCommand.TableCellVerticalAlign }
};
}
```
---
## TableToolbarCommand Enum Reference
Complete list of all valid `TableToolbarCommand` values:
| Value | Enum Name | Description |
|---|---|---|
| `0` | `HorizontalSeparator` | Legacy separator — organizes toolbar into segments |
| `1` | `TableHeader` | Toggle the header row of the table |
| `2` | `TableRows` | Add or remove rows (above / below) |
| `3` | `TableColumns` | Add or remove columns (left / right) |
| `4` | `BackgroundColor` | Set background color of selected cell(s) |
| `5` | `TableRemove` | Delete the entire table from the editor |
| `6` | `Alignments` | Align table cell content (left / center / right) |
| `7` | `TableCellVerticalAlign` | Adjust vertical alignment of cell content (top / middle / bottom) |
| `8` | `Styles` | Apply predefined border/style presets to the table |
| `9` | `TableEditProperties` | Open dialog to edit table attributes (dimensions, padding, etc.) |
| `10` | `TableCell` | Manage cell merge / split operations |
| `11` | `Separator` | Visual separator to group toolbar items into logical sections |
## Row and Column Selection
**Mouse:** Click and drag across cells to select multiple rows or columns.
**Keyboard:**
- `Shift + Arrow keys` — extend selection across cells.
- `Tab` — move to next cell; auto-inserts a row when in the last cell.
- `Shift + Tab` — move to previous cell.
**Select whole table:**
- Press `Backspace` immediately after the table.
- Press `Delete` immediately before the table.
---
## Merge and Split Cells
Merging and splitting requires `TableToolbarCommand.TableCell` to be in the quick toolbar.
1. Select two or more adjacent cells by clicking and dragging (or `Shift + Arrow`).
2. Click **Merge Cells** from the quick toolbar dropdown that appears.
To split a previously merged cell:
1. Click the merged cell.
2. Choose **Split Cell** from the quick toolbar.
---
## Custom Table Styles
Supply a `Styles` list on `RichTextEditorTableSettings` to add style options to the quick toolbar dropdown. Each item's `Value` should be a CSS class name you define in your stylesheet:
```razor
<SfRichTextEditor>
<RichTextEditorTableSettings Styles="@TableStyles" />
</SfRichTextEditor>
@code {
private List<DropDownItemModel> TableStyles = new()
{
new() { Text = "Dashed", Value = "e-dashed-borders" },
new() { Text = "Alternate", Value = "e-alternate-rows" }
};
}
```
```css
/* In your app's CSS */
.e-richtexteditor .e-rte-table.e-dashed-borders td,
.e-richtexteditor .e-rte-table.e-dashed-borders th {
border-style: dashed;
}
.e-richtexteditor .e-rte-table.e-alternate-rows tbody tr:nth-child(2n) {
background-color: #f4f4f4;
}
```
> Table styles are applied as CSS classes on the `<table>` element and are preserved in the saved HTML output.
---
## Cell Background Color
Use `TableToolbarCommand.BackgroundColor` in the table quick toolbar to set per-cell background colour from a colour picker. Combine with `Alignments`, `TableCellVerticalAlign`, and `TableEditProperties` for full cell-level control:
```razor
<SfRichTextEditor>
<RichTextEditorQuickToolbarSettings Table="@TableTools" />
</SfRichTextEditor>
@code {
private List<TableToolbarItemModel> TableTools = new()
{
new() { Command = TableToolbarCommand.BackgroundColor },
new() { Command = TableToolbarCommand.Alignments },
new() { Command = TableToolbarCommand.TableCellVerticalAlign },
new() { Command = TableToolbarCommand.Separator },
new() { Command = TableToolbarCommand.TableEditProperties },
new() { Command = TableToolbarCommand.TableRemove }
};
}
```
---
## Nesting Tables
Place the cursor inside a table cell and click **Create Table** again to insert a nested table. Nesting is useful for complex layouts such as structured forms or hierarchical data:
```razor
<!-- Pre-set nested table in Value -->
<SfRichTextEditor Value="@NestedHtml">
<RichTextEditorToolbarSettings Items="@Tools" />
</SfRichTextEditor>
@code {
private string NestedHtml = @"
<table border='1' style='width:100%;border-collapse:collapse;'>
<tr><th>Department</th><th>Details</th></tr>
<tr>
<td>Sales</td>
<td>
<table border='1' style='width:100%;border-collapse:collapse;'>
<tr><th>Employee</th><th>Target</th></tr>
<tr><td>John Doe</td><td>$50,000</td></tr>
</table>
</td>
</tr>
</table>";
}
```
---
## Quick Insert (Hover Icons)
- **Add column:** Hover over a cell in the **first row** → a dot appears at the top edge → hover the dot → click **+** to insert a column to the left.
- **Add row:** Hover over a cell in the **first column** → a dot appears at the left edge → hover the dot → click **+** to insert a row above.
---
## Copy / Cut / Paste Table Content
Select cells by dragging or `Shift + Arrow`, then use standard shortcuts:
| Action | Windows | Mac |
|---|---|---|
| Copy | `Ctrl + C` | `⌘ + C` |
| Cut | `Ctrl + X` | `⌘ + X` |
| Paste | `Ctrl + V` | `⌘ + V` |
Paste behaviour:
- Preserves table structure, formatting and cell properties
- Supports cross-table operations
- Compatible with content pasted from Excel and Word
- Handles partial table pastes as new tables or into existing cells
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| canvas-designanthropics/skillsCreate beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| docxanthropics/skillsUse this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include: any mention of 'Word doc', 'word document', '.docx', '.dotx', or requests to produce professional documents with formatting like tables of contents, headings, page numbers, or letterheads. Also use when extracting or reorganizing content from .docx or .dotx files, inserting or replacing images in documents, performing find-and-replace in Word files, working with tracked changes or comments, or converting content into a polished Word document. If the user asks for a 'report', 'memo', 'letter', 'template', or similar deliverable as a Word or .docx file, use this skill. Do NOT use for PDFs, spreadsheets, Google Docs, or general coding tasks unrelated to document generation. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| pdfanthropics/skillsUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple PDFs into one, splitting PDFs apart, rotating pages, adding watermarks, creating new PDFs, filling PDF forms, encrypting/decrypting PDFs, extracting images, and OCR on scanned PDFs to make them searchable. If the user mentions a .pdf file or asks to produce one, use this skill. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| pptxanthropics/skillsUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx or .potx file (even if the extracted content will be used elsewhere, like in an email or summary); editing, modifying, or updating existing presentations; combining or splitting slide files; working with templates (.potx), layouts, speaker notes, or comments. Trigger whenever the user mentions "deck," "slides," "presentation," or references a .pptx or .potx filename, regardless of what they plan to do with the content afterward. If a .pptx or .potx file needs to be opened, created, or touched, use this skill. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |