System.Web.UI.HtmlControls.HtmlTableCell.ColSpan Property

Gets or sets the number of columns occupied by a cell represented by an instance of the System.Web.UI.HtmlControls.HtmlTableCell class.

Syntax

[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
[System.ComponentModel.DefaultValue("")]
public int ColSpan { set; get; }

Value

Documentation for this section has not yet been entered.

Remarks

In a cell represented by an instance of the System.Web.UI.HtmlControls.HtmlTableCell class, use the HtmlTableCell.ColSpan property to specify the number of columns the cell occupies. This allows you to create a cell in the table that occupies more than one column. For example, suppose you have a table that contains two columns and two rows. You can create a table heading cell that spans both columns. Set the HtmlTableCell.ColSpan property of the leftmost cell in the first row to 2 to indicate that this cell takes up two columns in the table.

Note:

When spanning columns, be sure to define one fewer cell in the row for each column that you span. For example, if you span two columns, define one fewer cell in the current row. Otherwise, that row will be longer than the number of columns in the table and the table will not be displayed as expected.

Requirements

Namespace: System.Web.UI.HtmlControls
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0