English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The table cellpadding attribute specifies the spacing between the cell wall and cell content (in pixels). HTML5 The <table> cellpadding attribute is not supported, please use CSS instead
Set the spacing between the cell wall and cell content8Pixels:
<table cellpadding="8" border="1"> <tr> <th>Name</th> <th>Credits</th>/th> </tr> <tr> <td>Zhang San</td>/td> <td>90</tr>/td> </tr> <tr> <td>Li Si</td>/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 attributes may be confused, the cellspacing attribute specifies the space between cells.
Tip:From a practical point of view, it is better not to specify cellpadding, but to use CSS to add padding (padding).
<table cellpadding="pixels">
Value | Description |
---|---|
pixels | Specifies the space between the cell border and the cell content. |