Search This Blog

Tuesday, July 7, 2015

Table in RichTextBox WPF C#

WPF > Controls  > ContentControl > RichTextBox > Table

XAML

<Window x:Class="Editor.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
        <RichTextBox>
            <FlowDocument>
                <Table>
                    <TableRowGroup>
                        <TableRow>
                            <TableCell>
                                <Paragraph>Cell1</Paragraph>
                            </TableCell>
                            <TableCell>
                                <Paragraph>Cell2</Paragraph>
                            </TableCell>
                        </TableRow>
                    </TableRowGroup>
                </Table>
            </FlowDocument>
        </RichTextBox>
    </Grid>
</Window>