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

HTML Referenzhandbuch

Vollständiges Verzeichnis der HTML-Tags

HTML table cellpadding Eigenschaft

Die Eigenschaft <table> cellpadding gibt den Abstand zwischen Zellenwand und Zelleninhalt an (in Pixel). HTML5 Die Eigenschaft <table> cellpadding wird nicht unterstützt, verwenden Sie stattdessen CSS

 HTML <table> Tag

Online-Beispiel

Stellen Sie den Abstand zwischen Zellenwand und Zelleninhalt ein8Pixel:

<table cellpadding="8" border="1">
  <tr>
    <th>姓名</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 it out ‹/›

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 Attribute confusion, the cellspacing attribute specifies the space between cells.

Tip:From a practical point of view, it is best not to specify cellpadding and instead 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