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
var t = document.getElementById("TableA");
t.cellPadding = "10";

Specification

Browser compatibility

FeatureChromeEdgeFirefoxInternet ExplorerOperaSafari
Basic support Yes Yes Yes Yes Yes Yes
FeatureAndroid webviewChrome for AndroidEdge mobileFirefox for AndroidOpera AndroidiOS SafariSamsung Internet
Basic support Yes ? Yes Yes Yes Yes ?

Document Tags and Contributors

Contributors to this page: fscholz, vnctdj, teoli, kscarfone, Sheppy, ethertank, RobG, Dria, JesseW
Last updated by: fscholz,