English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
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
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 ‹/›
IEFirefoxOperaChromeSafari
All major browsers support the cellpadding attribute.
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).
<table cellpadding="pixels">
Value | Description |
---|---|
pixels | Specify the space between the cell border and the cell content. |