Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Revision 476147 of HTMLTableElement.cellSpacing

  • Revision slug: Web/API/HTMLTableElement.cellSpacing
  • Revision title: HTMLTableElement.cellSpacing
  • Revision id: 476147
  • Created:
  • Creator: Abin_Abraham
  • Is current revision? No
  • Comment

Revision Content

{{ DomRef("HTMLTableElement") }}

cellSpacing gets/sets the spacing around the individual cells of the table.

Syntax

HTMLTableElement.cellSpacing =spacing;
varspacing =HTMLTableElement.cellSpacing;
  • spacing is either a number of pixels (e.g. "10") or a percentage value (e.g. "10%").

Example

// Set the cell spacing to 10 pixels
var t = document.getElementById('TableA');
t.cellSpacing = "10";

Specification

Revision Source

<div>
  <div>
    {{ DomRef("HTMLTableElement") }}</div>
</div>
<p><b>cellSpacing</b> gets/sets the spacing around the individual cells of the table.</p>
<h2 id="Syntax" name="Syntax">Syntax</h2>
<pre class="syntaxbox"><i>HTMLTableElement</i>.cellSpacing =<i>spacing</i>;
var<i>spacing</i> =<i>HTMLTableElement</i>.cellSpacing;</pre>
<ul>
  <li><code>spacing</code> is either a number of pixels (e.g. "10") or a percentage value (e.g. "10%").</li>
</ul>
<h2 id="Example" name="Example">Example</h2>
<pre class="brush:js">// Set the cell spacing to 10 pixels
var t = document.getElementById('TableA');
t.cellSpacing = "10";</pre>
<h2 id="Specification" name="Specification">Specification</h2>
<ul>
  <li>W3C DOM 2 HTML Specification <a class="external" href="https://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-68907883">
    <i>
      HTMLTableElement</i>
    .cellSpacing</a>.</li>
</ul>
Revert to this revision