Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

IdxRichEditTableBorders Interface

Exposes internal and external table borders in a document.

#Declaration

Delphi
IdxRichEditTableBorders = interface(IInterface)

#Remarks

A table in a document allows you to hide or display internal and external borders as well as customize their appearance.

Tip

You can call a table’s Cell function to access individual cells and customize their borders.

#Main API Members

The list below outlines key members of the IdxRichEditTableBorders interface. You can use these members to access and customize corresponding internal and external table borders.

Bottom | Left | Right | Top
Allow you to customize the appearance of corresponding external table borders.
InsideHorizontalBorder | InsideVerticalBorder
Allow you to customize all internal horizontal and vertical table borders.

#Code Example: Insert and Configure a Table

The following code example creates a table populated with three columns and rows at the current caret position and customizes the table’s borders and background:

uses
  dxCoreGraphics;  // This unit declares TdxAlphaColor and TdxAlphaColors types
// ...
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');
    ATable.Borders.InsideHorizontalBorder.LineStyle := TdxRichEditTableBorderLineStyle.DotDotDash;
    ATable.Borders.InsideHorizontalBorder.LineColor := TdxAlphaColors.Firebrick;
    ATable.Borders.InsideVerticalBorder.LineStyle := TdxRichEditTableBorderLineStyle.Dotted;
    ATable.Borders.Bottom.LineStyle := TdxRichEditTableBorderLineStyle.ThinThickMediumGap;
    ATable.Borders.Bottom.LineThickness := 1.5;
    ATable.Borders.Bottom.LineColor := TdxAlphaColors.Red;
    ATable.Borders.Left.LineStyle := TdxRichEditTableBorderLineStyle.ThinThickMediumGap;
    ATable.Borders.Left.LineColor := TdxAlphaColors.Red;
    ATable.Borders.Left.LineThickness := 1.5;
    ATable.Borders.Right.LineStyle := TdxRichEditTableBorderLineStyle.ThinThickMediumGap;
    ATable.Borders.Right.LineColor := TdxAlphaColors.Red;
    ATable.Borders.Right.LineThickness := 1.5;
    ATable.Borders.Top.LineStyle := TdxRichEditTableBorderLineStyle.ThinThickMediumGap;
    ATable.Borders.Top.LineColor := TdxAlphaColors.Red;
    ATable.Borders.Top.LineThickness := 1.5;
    ATable.TableBackgroundColor := TdxAlphaColors.LightSalmon;
  finally
    ADocument.EndUpdate;  // Calls EndUpdate regardless of the batch operation's success
  end;
end;

VCL Rich Edit Control: A Table Example with Custom Border Appearance

#Direct IdxRichEditTableBorders Interface Reference

The IdxRichEditTable.Borders property references the IdxRichEditTableBorders interface.

#Inheritance

IInterface
IdxRichEditTableBorders
See Also