HtmlTableCell.ColSpan Property
Assembly: System.Web (in system.web.dll)
/** @property */ public int get_ColSpan () /** @property */ public void set_ColSpan (int value)
public function get ColSpan () : int public function set ColSpan (value : int)
Property Value
The number of columns occupied by the cell represented by an instance of HtmlTableCell. The default value is -1, which indicates that this property is not set.In a cell represented by an instance of the HtmlTableCell class, use the 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 ColSpan property of the leftmost cell in the first row to 2 to indicate that this cell takes up two columns in the table.
Caution |
|---|
| 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. |
Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.
Caution