Create Table layout in FlowDocument

image_pdfimage_print
   
     
<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>