Latest

recent

HTML Table cellpadding attribute

Example

The following example sets the space between the cell wall and the cell content to ten pixels:
<table border="1" cellpadding="10">
  <tr>
    <th>Month</th>
    <th>Savings</th>
  </tr>
  <tr>
    <td>January</td>
    <td>$100</td>
  </tr>
</table>


Definition and Usage

The cellpadding attribute specifies the space between the cell wall and the cell content.
Note: Do not confuse this with the cellspacing attribute, which specifies the space between cells.
For practical reasons, it may be better not to specify cellpadding, and use CSS to apply padding instead.

Browser Support

The cellpadding attribute is supported in all major browsers.

Syntax

<table cellpadding="value">

Attribute Values

Value Description
pixels The space between the cell wall and the cell content
HTML Table cellpadding attribute Reviewed by 1000sourcecodes on 02:30 Rating: 5
Powered by Blogger.