HTMLTableElement.cellPadding

The HTMLTableElement.cellPadding property represents the padding around the individual cells of the table.

Syntax

HTMLTableElement.cellPadding = padding;
var padding = HTMLTableElement.cellPadding;
  • padding is either a number of pixels (e.g. "10") or a percentage value (e.g. "10%").

Example

// Set cell padding to 10 pixels
let t = document.getElementById('TableA');
t.cellPadding = '10';

Specification

Browser compatibility

DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
cellPadding
Deprecated
Chrome Full support YesEdge Full support 12Firefox Full support YesIE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android ? Firefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android ?

Legend

Full support
Full support
Compatibility unknown
Compatibility unknown
Deprecated. Not for use in new websites.
Deprecated. Not for use in new websites.