IdxRichEditTable Interface
Exposes a table in a document.
Declaration
IdxRichEditTable = interface(IInterface)
Remarks
You can create simple or nested tables in a rich text document.
Main API Members
The list below outlines key members of the IdxRichEditTable
interface. You can use these members to configure table layout and appearance as well as access and edit individual cells.
Table Structure-Related API Members
- Cell | GetItem | Self
- Provide access to individual table cells by row and column indexes.
- FirstRow | LastRow
- Provide access to first and last rows in the table.
- ForEachRow
- Allows you to apply the same set of changes to all rows in the table.
- MergeCells
- Merges specified cells in the table.
- Rows
- Allows you to manage the table structure.
Table and Content Layout Settings
- BottomPadding | LeftPadding | RightPadding | TopPadding
- Specify individual paddings for cell content.
- PreferredWidth | PreferredWidthType | TableCellSpacing | TableLayout
- Specify general table layout settings.
Document-Related Settings
- Indent | TableAlignment
- Allow you to adjust the table’s position in the parent document.
- NestingLevel
- Returns the table’s nesting level.
- ParentCell
- Provides access to the table’s parent cell (if the table is nested).
- Range
- Returns the document range that corresponds to the table.
General Appearance Settings
- Borders
- Allows you to configure individual table borders.
- Style
- Provides access to table style settings.
- TableBackgroundColor
- Specifies the table’s background color.
General-Purpose API Members
- BeginUpdate | EndUpdate
- Allow you to avoid excessive redraw operations during batch table changes.
- Reset
- Restores initial table settings.
Code Example: Insert a Table at the Caret Position
The following code example creates a table with three rows and three columns at the current caret position and populates all cells in the table:
var
ADocument: IdxRichEditDocument;
ATable: IdxRichEditTable;
I, J: Integer;
begin
ADocument := dxRichEditControl1.Document;
ADocument.BeginUpdate; // Initiates the following batch change
try
ATable := ADocument.Tables.Add(ADocument.CaretPosition, 3, 3);
for I := 0 to ATable.Rows.Count - 1 do
for J := 0 to ATable.Rows.Self[I].Cells.Count - 1 do
ADocument.InsertText(ATable.Cell(I, J).Range.Start, 'Lorem ipsum dolor sit amet');
finally
ADocument.EndUpdate; // Calls EndUpdate regardless of the batch operation's success
end;
end;
Direct IdxRichEditTable Interface References
The following public API members reference the IdxRichEditTable
interface:
- IdxRichEditTableCollection.Add
- Creates a new table at the specified position within the parent document.
- IdxRichEditTableCollection.First
- Provides access to the first table in the collection.
- IdxRichEditTableCollection.Last
- Provides access to the last table in the collection.
- IdxRichEditTableCollection.Self
- Provides indexed access to stored tables.
Inheritance
IInterface
IdxRichEditTable
See Also