简体   繁体   中英

WPF add Paragraph into TableCell by code

How I can add two Paragraph in to TableCell by code? In XAML it's looks like

<TableCell>
    <Paragraph>first</Paragraph>
    <Paragraph>second</Paragraph>
</TableCell>

In code I can do like this

TableCell firstCell = new TableCell(new Paragraph(new Run("first")));

Try adding to the Blocks of the TableCell

Take a look at MSDN TableCell.Blocks

Ideally it would look something like this

//I did not test this code
TableCell firstCell = new TableCell();
firstCell.Blocks.Add(new Paragraph(new Run("first")));

Hope that was helpful!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM