This documentation is archived and is not being maintained.

HtmlTableCell::RowSpan Property

Gets or sets the number of rows occupied by a cell represented by an instance of the HtmlTableCell class.

Namespace:  System.Web.UI.HtmlControls
Assembly:  System.Web (in System.Web.dll)

public:
property int RowSpan {
	int get ();
	void set (int value);
}
<asp:HtmlTableCell RowSpan="Int32" />

Property Value

Type: System::Int32
The number of rows occupied by a cell represented by an instance of the HtmlTableCell class. 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 RowSpan property to specify the number of rows the cell occupies. This allows you to create a cell in the table that occupies more than one row. For example, suppose you have a table that contains two columns and two rows. You can create a column that overlaps both rows. Set the RowSpan property of the leftmost cell in the first column to 2 to indicate that this cell takes up two rows in the table.

Caution noteCaution:

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

The following code example demonstrates how to use the RowSpan property to specify that the cell in the first column of the HtmlTable control spans two rows.

No code example is currently available or this language may not be supported.

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0, 2.0, 1.1, 1.0
Show: