asp.net.ph

HtmlTableCellCollection.Add Method

System.Web.UI.HtmlControls Namespace   HtmlTableCellCollection Class


Adds the specified table cell object to the end of the Cells collection.

[ VB ]
Public Sub Add ( _
   ByVal cell As HtmlTableCell _
) 

[ C# ]
public void Add (
   HtmlTableCell cell
);

[ C++ ]
public: void Add (
   HtmlTableCell* cell
);

[ JScript ]
public function Add (
   cell : HtmlTableCell
);

Parameters

cell
The table cell object to add to the collection.

Remarks

Use this method to add the specified HtmlTableCell to the end of an HtmlTableCellCollection. If you need to insert an HtmlTableCell in a specified location in the collection, use the Insert method.

Example

The following example demonstrates how to use the Add method to append a new cell to the end of the Cells collection.

// loop through the given number of cells
for ( int c = 0; c < numcells; c++ ) {
   // instantiate a new cell
   HtmlTableCell cell = new HtmlTableCell ( );

   // add cell content
   cell.Controls.Add ( new LiteralControl ( "row " + r.ToString ( ) + 
      ", cell " + c.ToString ( ) ) );

   // add the cell to the Cells collection
   row.Cells.Add ( cell );
}

 Show me 

See Also

HtmlTableCellCollection Members Skip Navigation Links




Previous page Back to top Next page

Check out related books at Amazon

© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note