This article has been excerpted from book "A Programmer's Guide to ADO.NET in C#".As I approach the end if this article, I'd like to take a look at one other widely used Web control: the table control. A table Web control creates an HTML table in simple HTML with the help of the <tr> and <td> tags.You can use the <table>,<tr>, and <td> tags to create a table and its rows in HTML. For example, the HTML code in Listing 7-25 creates a table with two rows and three columns with their values.Listing 7-25. HTML code for a Table control <table border="1" width="39%"> <tr> <td width="33%"> Row1,Col1 </td> <td width="33%"> Row1,Col2 </td> <td width="34%"> Row1,Col3 </td> </tr> <tr> <td width="33%"> Row2,Col1 </td> <td width="33%"> Row2,Col2 </td> <td width="34%"> Row2,Col3 </td> </tr> </table>In the .NET Framework the Table class enables you to build an HTML table.The System.Web.UI.Controls namespace defines the Table class, along with the other Web controls. You can create tables in .NET using a Table control and its helper controls TableRow and TableCell. As with all Web controls, you can create a Table control at run-time as well as at design-time using the VS .NET IDE. Table 7-9 describes the Table control and its helper controls.Table 7-9 ASP.NET table and its Helper Control Classes
Table
<asp:Table>
The System.Web.UI.Table class encapsulates an HTML table. An HTML table control, used to creates a table with the help of TableRow and TableCell.
TableRow
<asp:TableRow>
The System.Web.UI.TableRow class encapsulates a row within a table, which later can be used to get or set row's cells values using TableCell.
TableCell
<asp:TableCell>
The System.Web.UI.TableCell class encapsulates a cell within a table.
TableRowCollection
<asp:TableRowCollection>
The System.Web.UI.TableCell class encapsulates a TableRowCollection and is used to manage a collection of table a collection or removing a row from it.
TableCellCollection
<asp:TableCellCollection>
Manages a collection of table cells such as adding a cell to a row or removing a cell from it.
TableHeaderCollection
<asp:TableHeaderCell>
Encapsulate a table header cell.
You need to be a premium member to use this feature. To access it, you'll have to upgrade your membership.
Become a sharper developer and jumpstart your career.
$0
$
. 00
monthly
For Basic members:
$20
For Premium members:
$45
For Elite members: