Wpf FlowDocument:TableColumn用法
System.Windows.Documents.TableColumnCollection.Columns定义状态: 获取System.Windows.Documents.TableColumnCollection对象,该对象包含该表承载的列。请注意,此数字可能不是表中呈现的实际列数。表中的System.Windows.Documents.TableCell对象决定实际呈现的列数。此属性没有默认值Wpf FlowDocument:TableColumn用法,wpf,c#-4.0,flowdocument,flowdocumentreader,Wpf,C# 4.0,Flowdocument,Flowdocumentreader,System.Windows.Documents.TableColumnCollection.Columns定义状态: 获取System.Windows.Documents.TableColumnCollection对象,该对象包含该表承载的列。请注意,此数字可能不是表中呈现的实际列数。表中的System.Windows.Documents.TableCell对象决定实际呈现的列数。此属性没有默认值 请帮助我想象一下为什么需要定义表列?A表由列和行组成。TableColumn定义了表格中的一列,
请帮助我想象一下为什么需要定义表列?A
表由列和行组成。TableColumn
定义了表格中的一列,表格中的每一行由一个或多个单元格组成,这些单元格由TableCell
元素表示。TableColumn
元素通常定义渲染单元格的列的宽度
希望以下示例标记能够说明我的意思:
<FlowDocument>
<Table>
<Table.Columns>
<TableColumn Width="2*" />
<TableColumn Width="1*" />
<TableColumn Width="1*" />
</Table.Columns>
<TableRowGroup>
<TableRow>
<TableCell>
<Paragraph>1</Paragraph>
</TableCell>
<TableCell>
<Paragraph>2</Paragraph>
</TableCell>
<TableCell>
<Paragraph>3</Paragraph>
</TableCell>
</TableRow>
</TableRowGroup>
</Table>
</FlowDocument>
1.
2.
3.
第一列占总宽度的一半,其余空间在第2列和第3列之间划分。如果您没有定义任何列,那么空间将在单元格之间平均分配。感谢您的响应@mm8,但是如果我添加了类似于“4”的内容,为什么我没有收到错误?抱歉,混淆了,从逻辑上讲,单元格能够拥有它想要的任意多的列是没有意义的。