Skip to end of metadata
Go to start of metadata

Remarks

You can specify the width of each column in TableColumn element. Similar to Grid, you can input a double length value, or use Auto and Star (*) unit type as the value of the Width property. Note that the column width specified will not always be applied as the width of the cell. If CellSpacing and border formatting are specified in Table element, the width of the cell will be the result of the column width subtracted with these values.

XAML

In the above code, three TableColumn elements are specified in the Table. The width of the first, second, and third column is 100, Auto, and 2* respectively. Note that Auto is equal to one-star (*) value.

TableColumn is not inherited from TextElement, so you cannot specify common flow element formatting in this element.

Definition

public class TableColumn : DependencyObject

Summary

The following table summarizes the members exposed in this class.

Public Constructors

TableColumn Constructor()Initializes a new instance of the TableColumn class.

Public Properties

BackgroundGets or sets the Brush applied to the column area.
WidthGets or sets the width of the column.

Fields

BackgroundPropertyIdentifies the Background dependency property.
WidthPropertyIdentifies the Width dependency property.

Public Constructors

public TableColumn()

Initializes a new instance of the TableColumn class.

Public Properties

public Brush Background { get; set; }

Gets or sets the Brush applied to the column area.

public GridLength Width { get; set; }

Gets or sets the width of the column.

Fields

public static readonly DependencyProperty BackgroundProperty

Identifies the Background dependency property.

public static readonly DependencyProperty WidthProperty

Identifies the Width dependency property.

  • No labels