ASP.NET CellPadding Property

Definition and Usage

The CellPadding property is used to set the spacing between the cell border and content (in pixels).

Syntax

<asp:Table CellPadding="px" runat="server">
Some Content
</asp:Table>
Property Description
px Specify the spacing between the cell border and content (in pixels).

Example

The following example sets the CellPadding property of the Table control:

<form runat="server">
<asp:Table id="tab1" runat="server"> CellPadding="30">
<asp:TableRow>
<asp:TableCell>
Hello!
</asp:TableCell>
</asp:TableRow>
</asp:Table>
</form>

Example

Set CellPadding for Table Control