---
title: "Table in ASP.Net"  
description: "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"  
author: "Pushpendra Singh"  
published: 2010-10-18  
updated: 2019-11-13  
canonical: https://www.mindstick.com/articles/170/table-in-asp-dot-net  
category: "asp.net"  
tags: ["asp.net"]  
reading_time: 1 minute  

---

# Table 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](https://www.mindstick.com/mindstickarticle/9875d4f2-4d46-4488-830d-2e5d51ae4a53/images/64479317-2707-4328-a27f-7e6e89515b7f.png)

---

Original Source: https://www.mindstick.com/articles/170/table-in-asp-dot-net

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
