System.Web.UI.HtmlControls Namespace HtmlTableCellCollection Class
Removes the table cell at the specified index from the Cells collection.
[ VB ]
Public Sub RemoveAt ( _
ByVal index As Integer _
)
[ C# ]
public void RemoveAt (
int index
);
[ C++ ]
public: void RemoveAt (
int index
);
[ JScript ]
public function RemoveAt (
index : int
);
- index
- The index of the table cell to be removed.
Use this method to remove the HtmlTableCell at the specified index from an HtmlTableCellCollection. The index number is zero-based; therefore, the first item in the collection has an index value of 0.
NOTE: An ArgumentOutOfRangeException is raised if you specify an index that is outside the range of index values in the collection.
The following example demonstrates how to use the RemoveAt method to remove the cells from the first column of an HtmlTable.
// iterate through the rows of the table
for ( int row = 0; row <= myTable.Rows.Count - 1; row++ ) {
// remove the cell from the first column
myTable.Rows [ row ].Cells.RemoveAt ( 0 );
}
Show me
HtmlTableCellCollection Members Cells.Remove Cells.Clear