Skip to content

ICellWriter

Dustin Horne edited this page Mar 5, 2026 · 1 revision

ICellWriter

Namespace: ParentElement.RichText.Core.Tables

Write-only abstraction for populating a table cell's content programmatically. Instances of ICellWriter are provided by InlineTable.WriteToCell and are only valid for the duration of the populate callback.

public interface ICellWriter

Methods

Method Returns Description
Insert(string) void Insert raw text at the current caret position
ApplyStyle(IStyle) void Set the character style for subsequent Insert calls
ApplyAlignment(TextAlignment) void Set the paragraph alignment of the current paragraph
ApplyListFormat(ListType, int) void Apply a list type and nesting level directly
SetBlockIndent(float) void Set the left block indent of the current paragraph in pixels
AdjustLineSpacing(float) void Set the line-height multiplier for the current paragraph
InsertInlineImage(SKImage, float, float) void Insert an inline image at the current caret position

Usage

ICellWriter is obtained exclusively through InlineTable.WriteToCell:

var table = editor.InsertTable(new TableOptions { Rows = 2, Columns = 3 });

table.WriteToCell(0, 0, writer =>
{
    writer.ApplyStyle(boldStyle);
    writer.Insert("Header");
});

table.WriteToCell(1, 0, writer =>
{
    writer.Insert("Row 1, Col 1");
});

See also: Tables · IDocumentController

Clone this wiki locally