mirror of
https://github.com/Stone-Red-Code/docs-desktop.git
synced 2026-09-07 07:56:07 +02:00
* net-current-v30plus-md.md * net-current-v40plus-md.md * tla2sharptla-ui-md.md * tla2sharptla-uiautomation-md.md * tla2sharptla-winclient-md.md * tla2sharptla-xaml-md.md * tlasharptla-ui-md.md * tlasharptla-uiautomation-md.md * tlasharptla-winclient-md.md * tlasharptla-xaml-md.md * fix warnings
19 lines
1.5 KiB
Markdown
19 lines
1.5 KiB
Markdown
---
|
|
title: "How to: Define a Table with XAML"
|
|
ms.date: "03/30/2017"
|
|
helpviewer_keywords:
|
|
- "XAML [WPF], defining tables"
|
|
- "documents [WPF], defining tables with XAML"
|
|
- "tables [WPF], defining with XAML"
|
|
ms.assetid: 83f2dc58-437e-4cdc-b5dd-0019810c7a85
|
|
---
|
|
# How to: Define a Table with XAML
|
|
The following example demonstrates how to define a <xref:System.Windows.Documents.Table> using Extensible Application Markup Language (XAML). The example table has four columns (represented by <xref:System.Windows.Documents.TableColumn> elements) and several rows (represented by <xref:System.Windows.Documents.TableRow> elements) containing data as well as title, header, and footer information. Rows must be contained in a <xref:System.Windows.Documents.TableRowGroup> element. Each row in the table is comprised of one or more cells (represented by <xref:System.Windows.Documents.TableCell> elements). Content in a table cell must be contained in a <xref:System.Windows.Documents.Block> element; in this case <xref:System.Windows.Documents.Paragraph> elements are used. The table also hosts a hyperlink (represented by the <xref:System.Windows.Documents.Hyperlink> element) in the footer row.
|
|
|
|
## Example
|
|
[!code-xaml[TableSnippetsXAML#_TableXAML](~/samples/snippets/csharp/VS_Snippets_Wpf/TableSnippetsXAML/CS/Window1.xaml#_tablexaml)]
|
|
|
|
The following figure shows how the table defined in this example renders:
|
|
|
|

|