#249 – 在FlowDocument中创建表格(Creating a Table in a FlowDocument)

2016-09-07 19:20:19来源:CSDN作者:Libby1984人点击

你可以使用TableFlowDocument 添加列表。通过行列布局呈现表格。

<FlowDocument FontFamily="Cambria" FontSize="14">    <Paragraph>Some Pixar films:</Paragraph>    <Table>        <Table.Columns>            <TableColumn Width="50*"/>            <TableColumn Width="15*"/>            <TableColumn />        </Table.Columns>         <TableRowGroup Background="LightGray" FontWeight="Bold">            <TableRow>                <TableCell><Paragraph>Title</Paragraph></TableCell>                <TableCell><Paragraph>Year</Paragraph></TableCell>                <TableCell><Paragraph>Director</Paragraph></TableCell>            </TableRow>        </TableRowGroup>         <TableRowGroup FontFamily="Verdana" FontSize="12">            <TableRow>                <TableCell><Paragraph>Toy Story</Paragraph></TableCell>                <TableCell><Paragraph>1995</Paragraph></TableCell>                <TableCell><Paragraph>John Lasseter</Paragraph></TableCell>            </TableRow>            <TableRow>                <TableCell><Paragraph>Monster's, Inc.</Paragraph></TableCell>                <TableCell><Paragraph>2001</Paragraph></TableCell>                <TableCell><Paragraph>Pete Docter</Paragraph></TableCell>            </TableRow>            <TableRow>                <TableCell><Paragraph>The Incredibles</Paragraph></TableCell>                <TableCell><Paragraph>2004</Paragraph></TableCell>                <TableCell><Paragraph>Brad Bird</Paragraph></TableCell>            </TableRow>        </TableRowGroup>    </Table></FlowDocument>

效果图


原文地址:https://wpf.2000things.com/2011/03/18/249-creating-a-table-in-a-flowdocument/



最新文章

123

最新摄影

微信扫一扫

第七城市微信公众平台