Table Properties Dialog
- 3 minutes to read
Overview
The Table Properties dialog allows users to change settings of an entire table and its elements: rows, columns, and cells.
Click Properties or Cell Size dialog box launcher on the Table Tools | Layout ribbon tab to invoke this dialog. Refer to the How to: Create a RichEditControl with a Ribbon UI topic for information on how to add the ribbon UI to the RichEditControl.
The Table Properties dialog is also available from the context menu.
The dialog consists of the following tabs:
Table
Table tab options allow users to set preferred table width, alignment (table position relative to page margins), text wrapping and direction.
The following API allows you to specify Table options in code:
Member | Description |
---|---|
Table.SetPreferredWidth | Specifies the table width. |
Table.TableAlignment | Specifies the table alignment. This property is ignored if the TextWrappingType is set to Around. |
Table.TextWrappingType | Specifies the text wrapping around the table. |
The Options… button invokes the Table Options dialog used to specify cell margins, spacing and whether to resize cells to fit content.
Member | Description |
---|---|
TableCell.TopPadding | Specifies the cell’s top margin. |
TableCell.RightPadding | Specifies the cell’s right margin. |
TableCell.BottomPadding | Specifies the cell’s bottom margin. |
TableCell.LeftPadding | Specifies the cell’s left margin. |
Table.TableCellSpacing | Specifies the spacing between cells. |
The Borders and Shading… button invokes the Borders and Shading dialog. Set the Text Wrapping option to Around to enable the Positioning button (used to invoke the Table Positioning dialog).
Row
The Row tab allows users to set the row height.
Use the following properties to specify row settings in code:
API | Description |
---|---|
TableRow.HeightType | Gets or sets the rule type that determines the row height. |
TableRow.Height | specifies the row height. |
TableRow.RepeatAsHeaderRow | Defines whether to repeat a row as header at the top of each page. |
TableRow.BreakAcrossPages | Specifies whether the row can be split when the table expands to another page. |
Column
On the Column tab, users can set tick the Preferred width box to specify column width.
Use the following API to set column width in code:
API | Description |
---|---|
Table.ForEachCell() | Allows you to specify width for each table cell. |
TableCell.PreferredWidthType | Gets or sets the width type. |
TableCell.PreferredWidth | Defines cell width. |
Cell
Cell tab options allow users to set the preferred table cell width and select the vertical alignment of cell content
The API from the table below allows you to specify the Cell options in code:
Member | Description |
---|---|
TableCell.PreferredWidthType | Gets or sets the width type. |
TableCell.PreferredWidth | Defines the cell width. |
TableCell.VerticalAlignment | Specifies cell content’s alignment. |
The Options… button invokes the Cell Options dialog. Use this dialog to to change cell margins (the space between cell borders and cell content) and specify whether to wrap the cell content.
Member | Description |
---|---|
TableCell.TopPadding | Specifies the cell’s top margin. |
TableCell.RightPadding | Specifies the cell’s right margin. |
TableCell.BottomPadding | Specifies the cell’s bottom margin. |
TableCell.LeftPadding | Specifies the cell’s left margin. |
TableCell.WordWrap | Gets os sets whether to wrap cell content. |
Invoke the Dialog in Code
The ShowTablePropertiesFormCommand command invokes the Table Properties dialog.
Handle the RichEditControl.TablePropertiesFormShowing and RichEditControl.TableOptionsFormShowing event to customize the default Table Properties and Table Options dialogs (modify captions, set default dialog values, implement custom validation, etc.) or substitute them with completely new dialogs. Refer to the How to: Customize the Search Form or How to: Customize the Hyperlink Form document for a code sample.