asp.net.ph

Skip Navigation Links

CELLPADDING Attribute | cellPadding Property

Language References


Sets or retrieves the amount of space between the border of the cell and its contents.

Syntax


Inline <TABLE CELLPADDING = iPadding [ % ] ... >
Script table.cellPadding = iPadding ]

Possible Values


iPadding Integer specifying the amount of space between the border and the content, in pixels.
iPadding% Integer followed by a percent sign ( % ). This indicates the amount of space between the border and the content as a percentage of the available space.

The property is read/write with no default value.

Remarks

If the value of this attribute is a pixel length, all four margins should be this distance from the contents.

If the value of the attribute is a percentage length, the top and bottom margins should be equally separated from the content based on a percentage of the available vertical space, and the left and right margins should be equally separated from the content based on a percentage of the available horizontal space.

Example

The following example demonstrates use of both the CSS CELLPADDING style attribute and the cellPadding property.

<table id="theTable" border cellPadding=10>
<tr>
   <th>Header 1</td>
   <th>Header 2</th>
   <th>Header 3</th></tr>
<tr>
   <td>Cell 1</td>
   <td>Cell 2</td>
   <td>Cell 3</td></tr>
</table>
<br>
<button onclick="theTable.cellPadding=15">More</button>
<button onclick="theTable.cellPadding=10">Reset</button>
<button onclick="theTable.cellPadding=5">Less</button>

This feature requires Microsoft® Internet Explorer® 4.0 or later.

 Show me 

Applies To

TABLE

See Also

cellSpacing



© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

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