Create Table layout in FlowDocument : FlowDocument « Windows Presentation Foundation « C# / C Sharp






Create Table layout in FlowDocument

     
<FlowDocument xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
  <Table CellSpacing="5">
    <Table.Columns>
      <TableColumn/>
      <TableColumn/>
      <TableColumn/>
      <TableColumn/>
    </Table.Columns>
    <TableRowGroup>
      <TableRow Background="SkyBlue">
        <TableCell ColumnSpan="4" TextAlignment="Center">
          <Paragraph FontSize="24pt" FontWeight="Bold">Table</Paragraph>
        </TableCell>
      </TableRow>
      <!-- Header row for the table. -->
      <TableRow Background="LightGoldenrodYellow">
        <TableCell>
          <Paragraph FontSize="14pt" FontWeight="Bold">Title 1</Paragraph>
        </TableCell>
        <TableCell>
          <Paragraph FontSize="14pt" FontWeight="Bold">Title 2</Paragraph>
        </TableCell>
        <TableCell>
          <Paragraph FontSize="14pt" FontWeight="Bold">Title 3</Paragraph>
        </TableCell>
        <TableCell>
          <Paragraph FontSize="14pt" FontWeight="Bold">Title 4</Paragraph>
        </TableCell>
      </TableRow>

      <!-- Sub-title row -->
      <TableRow>
        <TableCell ColumnSpan="4">
          <Paragraph FontSize="14pt" FontWeight="Bold">sub title</Paragraph>
        </TableCell>
      </TableRow>

      <TableRow Background="lightgray">
        <TableCell>
          <Paragraph>A</Paragraph>
        </TableCell>
        <TableCell>
          <Paragraph>1</Paragraph>
        </TableCell>
        <TableCell>
          <Paragraph>1</Paragraph>
        </TableCell>
        <TableCell>
          <Paragraph>1</Paragraph>
        </TableCell>
      </TableRow>
      <TableRow>
        <TableCell>
          <Paragraph>B</Paragraph>
        </TableCell>
        <TableCell>
          <Paragraph>1</Paragraph>
        </TableCell>
        <TableCell>
          <Paragraph>1</Paragraph>
        </TableCell>
        <TableCell>
          <Paragraph>1</Paragraph>
        </TableCell>
      </TableRow>
      <!-- Sub-title row -->
      <TableRow>
        <TableCell ColumnSpan="4">
          <Paragraph FontSize="14pt" FontWeight="Bold">sub title</Paragraph>
        </TableCell>
      </TableRow>
      <!-- Four data rows for the major outter planets. -->
      <TableRow Background="lightgray">
        <TableCell>
          <Paragraph>C</Paragraph>
        </TableCell>
        <TableCell>
          <Paragraph>1</Paragraph>
        </TableCell>
        <TableCell>
          <Paragraph>1</Paragraph>
        </TableCell>
        <TableCell>
          <Paragraph>5</Paragraph>
        </TableCell>
      </TableRow>
      <!-- Footer row for the table. -->
      <TableRow>
        <TableCell ColumnSpan="4">
          <Paragraph FontSize="10pt" FontStyle="Italic">
            <Hyperlink NavigateUri="http://your host">website</Hyperlink>
          </Paragraph>
        </TableCell>
      </TableRow>
    </TableRowGroup>
  </Table>
</FlowDocument>

   
    
    
    
    
  








Related examples in the same category

1.FlowDocument with SectionFlowDocument with Section
2.FlowDocument with UI containerFlowDocument with UI container
3.FlowDocument with TableFlowDocument with Table
4.Span and FlowDoucmentSpan and FlowDoucment
5.FlowDocument with Figure.xamlFlowDocument with Figure.xaml
6.Paragraph FontWeightParagraph FontWeight
7.FlowDocument with Hyperlink and ListFlowDocument with Hyperlink and List
8.Adding style to ParagraphAdding style to Paragraph
9.Bold text in Flow documentBold text in Flow document
10.Figures in a FlowDocumentFigures in a FlowDocument
11.Styled DocumentStyled Document
12.Add ListItem to FlowDocumentAdd ListItem to FlowDocument
13.FlowDocument with TextAlignment, ColumnWidth. Italic and bold fontFlowDocument with TextAlignment, ColumnWidth. Italic and bold font
14.Flow Document ReaderFlow Document Reader
15.Add FlowDocument to ButtonAdd FlowDocument to Button
16.FlowDocument with imagesFlowDocument with images
17.Add Shape(Ellipse, Rectangle) to ListAdd Shape(Ellipse, Rectangle) to List
18.Change FlowDocument Width and HeightChange FlowDocument Width and Height
19.Programmatically change the FlowDirection of content within a FlowDocumentReader elementProgrammatically change the FlowDirection of content within a FlowDocumentReader element
20.Use FlowDocumentReader to display FlowDocumentUse FlowDocumentReader to display FlowDocument
21.Programmatically Create and Save a FlowDocumentProgrammatically Create and Save a FlowDocument
22.Use XamlDesignerSerializationManager to write FlowDocumentUse XamlDesignerSerializationManager to write FlowDocument
23.Show FlowDocumentShow FlowDocument
24.Load a FlowDocument into a FlowDocumentReader,Load a FlowDocument into a FlowDocumentReader,
25.Convert Xaml file to FlowDocument with as operator
26.Save a FlowDocument as a Extensible Application Markup Language (XAML) file
27.Clear FlowDocumentReaderClear FlowDocumentReader
28.Programmatically add rows to a Table element.Programmatically add rows to a Table element.
29.Table Flow ContentTable Flow Content
30.Annotation ServiceAnnotation Service
31.Toggle Hyphenation, Optimal Paragraph, and Column FlexToggle Hyphenation, Optimal Paragraph, and Column Flex
32.Change font Change font