HTML Table Control in ASP.Net

The Table control is used in conjunction with the Table Cell control and the Table Row control to create a table. The Table Web server control manages data in tabular form.

<table cellpadding="2">

<tr>

<td>&nbsp;</td>

            <td>&nbsp;</td>

            <td>&nbsp;</td>

</tr>

<tr>

            <td>&nbsp;</td>

            <td>&nbsp;</td>

            <td>&nbsp;</td>

</tr>

<tr>

            <td>&nbsp;</td>

            <td>&nbsp;</td>

<td>&nbsp;</td>

</tr>

</table>

 

<tr> </tr> specified the Row of the table.

<td> </td> specified the cell of the Row.

Properties:

Cell Padding: Gets/Sets the distance between the border and the contents of the table cell
Cell Spacing: Gets/Sets the distance between table cells
Horizontal Align: Gets/Sets the horizontal alignment of the table within the page
Rows: Gets/Sets the collection of rows within the table

Change Table background color

<table cellpadding="2" class="style1" frame="box" style="border-collapse: collapse; background-color: #C0C0C0;">

<tr>

<td>&nbsp;</td>

            <td>&nbsp;</td>

            <td>&nbsp;</td>

</tr>

<tr>

            <td>&nbsp;</td>

            <td>&nbsp;</td>

            <td>&nbsp;</td>

</tr>

<tr>

            <td>&nbsp;</td>

            <td>&nbsp;</td>

            <td>&nbsp;</td>

</tr>

</table>

HTML Table Control in ASP.Net

Leave Comment