English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Manual de referência HTML

大全 de etiquetas HTML

Propriedade cellpadding do table HTML

A propriedade cellpadding do table especifica o espaçamento entre a parede da célula e o conteúdo da célula (em pixels). HTML5 A propriedade cellpadding do <table> não é suportada, use CSS em vez disso

 HTML <table> tag

Exemplo online

Defina o espaçamento entre a parede da célula e o conteúdo da célula8pixels:

<table cellpadding="8" border="1">
  <tr>
    <th>Nome</th>
    <th>Credits</th>
  </tr>
  <tr>
    <td>Zhang San</td>
    <td>90</td>
  </tr>
  <tr>
    <td>Li Si</td>
    <td>87</td>
  </tr>
</table>
Test and see ‹/›

Browser compatibility

IEFirefoxOperaChromeSafari

All major browsers support the cellpadding attribute.

Definition and usage

HTML5 The <table> cellpadding attribute is not supported, please use CSS instead.

The cellpadding attribute specifies the space between the cell border and the cell content, in pixels.

Note:Do not confuse this attribute with cellspacing Attributes may be confused, the cellspacing attribute specifies the space between cells.

Tip:From a practical point of view, it is best not to specify cellpadding, but to use CSS to add padding (inner margin).

Syntax

<table cellpadding="pixels">

Attribute value

ValueDescription
pixelsSpecify the space between the cell border and the cell content.
 HTML <table> tag