asp.net.ph

HtmlTableCellCollection.Insert Method

System.Web.UI.HtmlControls Namespace   HtmlTableCellCollection Class


Adds a table cell object at a specified index location in the Cells collection.

[ VB ]
Public Sub Insert ( _
   ByVal index As Integer, _
   ByVal cell As HtmlTableCell _
) 

[ C# ]
public void Insert (
   int index,
   HtmlTableCell cell
);

[ C++ ]
public: void Insert (
   int index,
   HtmlTableCell* cell
);

[ JScript ]
public function Insert (
   index : int,
   cell : HtmlTableCell
);

Parameters

index
The location in the collection at which to add the table cell.
cell
The table cell object to add to the collection.

Remarks

Use the Insert method to add the specified HtmlTableCell to an HtmlTableCellCollection at the specified index. If you need to simply append an HtmlTableCell to the end of the collection, use the Add method.

Example

The following example demonstrates how to use the Insert method to dynamically insert a table cell at a specified index in 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 ( ) ) );

   // insert the cell to the Cells collection
   row.Cells.Insert ( c, cell );
}

 Show me 

See Also

HtmlTableCellCollection Members Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

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

You can help support asp.net.ph