This is a migrated thread and some comments may be shown as answers.

Right align an entire table

1 Answer 49 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Bob asked on 21 Sep 2011, 08:38 PM
Is it possible to align an entire table to the right margin?

1 Answer, 1 is accepted

Sort by
0
Iva Toteva
Telerik team
answered on 27 Sep 2011, 12:01 PM
Hi Bob,

In the latest Q2 SP1 release (2011.2 920), we introduced a property called TableIndent, which is similar to the ParagraphIndent property. By setting it, you can have the table indented to a position different than right next to the end of the margin. You can test how the TableIndent property works in our Silverlight demo by dragging the thumbs in the DocumentRuler below the ribbon UI. It works the same way in the WPF version, too.
You can set the TableIndent of a Table in code-behind like this:

if (this.radRichTextBox1.Document.CaretPosition.IsPositionInsideTable)
{
    Table table = this.radRichTextBox1.Document.CaretPosition.GetCurrentTableCellBox().Parent.Parent.AssociatedDocumentElement as Table;
    table.TableIndent += 30;
    this.radRichTextBox1.UpdateEditorLayout();
}

However, the commands which align the text to the left/center/right/justify have not been made to respect this property yet. We will add this suggestion to our to-do list for future implementation.

All the best,
Iva
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
RichTextBox
Asked by
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Answers by
Iva Toteva
Telerik team
Share this question
or