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


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


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


Browser compatibility

Update compatibility data on GitHub
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
Basic support
Chrome Full support YesEdge Full support YesFirefox Full support YesIE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android ? Edge Mobile Full support YesFirefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android ?


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

Document Tags and Contributors

Last updated by: mdnwebdocs-bot,