officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-table-1203ffdc.md
Gets or sets the alignment of a table as a whole within the document.
Namespace : DevExpress.XtraRichEdit.API.Native
Assembly : DevExpress.RichEdit.v25.2.Core.dll
NuGet Package : DevExpress.RichEdit.Core
TableRowAlignment TableAlignment { get; set; }
Property TableAlignment As TableRowAlignment
| Type | Description |
|---|---|
| TableRowAlignment |
A TableRowAlignment enumeration value that specifies how the table is aligned in a document.
|
Available values:
| Name | Description |
|---|---|
| Both |
Justified.
| | Center |
Align center.
| | Distribute |
Distribute all characters equally.
| | Left |
Align left.
| | NumTab |
Align to the list tab.
| | Right |
Align right.
|
The TableAlignment property is ignored if the Table.TextWrappingType property is set to TableTextWrappingType.Around.
The TableAlignment property does not affect the table row alignment. To change the row alignment, iterate through rows and set the TableRow.TableRowAlignment property as required.
foreach(TableRow row in tab.Rows)
row.TableRowAlignment = TableRowAlignment.Right;
For Each row As TableRow In tab.Rows
row.TableRowAlignment = TableRowAlignment.Right
Next row
The following code snippets (auto-collected from DevExpress Examples) contain references to the TableAlignment property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
winforms-richedit-document-api/CS/RichEditAPISample/CodeExamples/Table.cs#L54
table.TableAlignment = TableRowAlignment.Center;
table.TableLayout = TableLayoutType.Fixed;
wpf-richedit-document-api/CS/DXRichEditControlAPISample/CodeExamples/TableActions.cs#L58
table.TableAlignment = TableRowAlignment.Center;
table.TableLayout = TableLayoutType.Fixed;
word-document-api-examples/CS/CodeExamples/TablesActions.cs#L85
// Align the table.
table.TableAlignment = TableRowAlignment.Center;
word-document-api-invoke-print-preview-dialog/VB/Form1.vb#L40
_table.Borders.InsideVerticalBorder.LineStyle = BorderLineStyle.Double
_table.TableAlignment = TableRowAlignment.Center
_table.ForEachCell(Sub(cell, rowIndex, columnIndex) richServer.Document.InsertText(cell.Range.Start, String.Format("{0}*{1} is {2}", rowIndex + 2, columnIndex + 2, (rowIndex + 2) * (columnIndex + 2))))
winforms-richedit-document-api/VB/RichEditAPISample/CodeExamples/Table.vb#L47
Dim table As DevExpress.XtraRichEdit.API.Native.Table = document.Tables.Create(document.Range.Start, 3, 4)
table.TableAlignment = DevExpress.XtraRichEdit.API.Native.TableRowAlignment.Center
table.TableLayout = DevExpress.XtraRichEdit.API.Native.TableLayoutType.Fixed
wpf-richedit-document-api/VB/DXRichEditControlAPISample/CodeExamples/TableActions.vb#L49
table.TableAlignment = TableRowAlignment.Center
table.TableLayout = TableLayoutType.Fixed
word-document-api-examples/VB/CodeExamples/TablesActions.vb#L80
' Align the table.
table.TableAlignment = DevExpress.XtraRichEdit.API.Native.TableRowAlignment.Center
' Set the table width to a fixed value.
See Also