W3cubDocs

/DOM

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 compatibilityUpdate compatibility data on GitHub

Desktop
Chrome Edge Firefox Internet Explorer Opera Safari
Basic support Yes Yes Yes Yes Yes Yes
Mobile
Android webview Chrome for Android Edge Mobile Firefox for Android Opera for Android iOS Safari Samsung Internet
Basic support Yes ? Yes Yes Yes Yes ?

© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableElement/cellPadding