System.Web.UI.HtmlControls Namespace HtmlTableRowCollection Class
Adds the specified table row object to the end of the Rows collection.
[ VB ]
Public Sub Add ( _
ByVal row As HtmlTableRow _
)
[ C# ]
public void Add (
HtmlTableRow row
);
[ C++ ]
public: void Add (
HtmlTableRow* row
);
[ JScript ]
public function Add (
row : HtmlTableRow
);
- row
- The table row object to add to the collection.
Use this method to add the specified HtmlTableRow to the end of an HtmlTableRowCollection. If you need to insert an HtmlTableRow in a specified location in the collection, use the Insert method.
The following example demonstrates how to use the Add method to append a new row to the end of the Rows collection.
// loop through the given number of rows
for ( int r = 0; r < numrows; r++ ) {
// instantiate a new row
HtmlTableRow row = new HtmlTableRow ( );
// loop through the given number of cells
for ( int c = 0; c < numcells; c++ ) {
// ... code to add cells here ...
}
// add the row to the Rows collection
myTable.Rows.Add ( row );
}
Show me
HtmlTableRowCollection Members