recursal/MDN huggingface dataset:
HTMLTableElement: deleteRow() method
====================================

 The **`HTMLTableElement.deleteRow()`** method removes a
 specific row (`<tr>`) from a given `<table>`.

Syntax
------


```js
deleteRow(index)
```

### Parameters

`index`

`index` is an integer representing the row that should be deleted.
 However, the special index `-1` can be used to remove the very last row of
 a table.


### Return value

None (`undefined`).

### Exceptions

`IndexSizeError` `DOMException`

Thrown if `index` is greater than or equal to the number of available rows or is a negative value other than `-1`.

Examples
--------

This example uses JavaScript to delete a table's second row.

### HTML


```html
<table>
  <tr>
    <td>Cell 1.1</td>
    <td>Cell 1.2</td>
    <td>Cell 1.3</td>
  </tr>
  <tr>
    <td>Cell 2.1</td>
    <td>Cell 2.2</td>
    <td>Cell 2.3</td>
  </tr>
  <tr>
    <td>Cell 3.1</td>
    <td>Cell 3.2</td>
    <td>Cell 3.3</td>
  </tr>
</table>
```

### JavaScript


```js
let table = document.querySelector("table");

// Delete second row
table.deleteRow(1);
```

### Result

Specifications
--------------

| Specification |
| --- |
| HTML Standard # dom-table-deleterow-dev |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
HTMLTableElement: createTFoot() method
======================================

 The **`createTFoot()`** method of
 `HTMLTableElement` objects returns the `<tfoot>` element
 associated with a given `<table>`. If no footer exists in the table, this
 method creates it, and then returns it.


**Note:** If no footer exists, `createTFoot()` inserts a new
 footer directly into the table. The footer does not need to be added separately as
 would be the case if `Document.createElement()` had been used to create
 the new `<tfoot>` element.


Syntax
------


```js
createTFoot()
```

### Parameters

None.

### Return value

`HTMLTableSectionElement`Examples
--------


```js
let myfoot = mytable.createTFoot();
// Now this should be true: myfoot === mytable.tFoot
```

Specifications
--------------

| Specification |
| --- |
| HTML Standard # dom-table-createtfoot-dev |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
HTMLTableElement: caption property
==================================

 The **`HTMLTableElement.caption`** property represents the
 table caption. If no caption element is associated with the table, this property is
 `null`.

Value
-----

A string.

Examples
--------


```js
if (table.caption) {
  // Do something with the caption
}
```

Specifications
--------------

| Specification |
| --- |
| HTML Standard # dom-table-caption-dev |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* The interface implementing this property: `HTMLTableElement`.
HTMLTableElement: summary property
==================================

**Deprecated:** This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

 The **`HTMLTableElement.summary`** property represents the
 table description.

Value
-----

A string.

Examples
--------


```js
HTMLTableElement.summary = "Usage statistics";
```

Specifications
--------------

* W3C DOM 2 HTML Specification
Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
HTMLTableElement: border property
=================================

**Deprecated:** This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

 The **`HTMLTableElement.border`** property represents the
 border width of the `<table>` element.

Value
-----

A string representing the width of the border in pixels.

Examples
--------


```js
// Set the width of a table border to 2 pixels
const t = document.getElementById("TableA");
t.border = "2";
```

Specifications
--------------

W3C DOM 2 HTML Specification *HTMLTableElement.border*.

This attribute is deprecated in HTML 4.0.

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
HTMLTableElement: tHead property
================================

 The **`HTMLTableElement.tHead`** represents the
 `<thead>` element of a `<table>`. Its value will be
 `null` if there is no such element.

Value
-----

A `HTMLTableSectionElement`.

Examples
--------


```js
if (table.tHead === my_head_el) {
  // …
}
```

Specifications
--------------

| Specification |
| --- |
| HTML Standard # dom-table-thead-dev |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* The interface implementing this property: `HTMLTableElement`.
HTMLTableElement: cellPadding property
======================================

**Deprecated:** This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

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

Value
-----

A string representing pixels (e.g. "10") or a percentage value (e.g. "10%").

Examples
--------


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

Specifications
--------------

* W3C DOM 2 HTML Specification *HTMLTableElement.cellPadding*.
Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
HTMLTableElement: tBodies property
==================================

 The **`HTMLTableElement.tBodies`** read-only property returns a
 live `HTMLCollection` of the bodies in a `<table>`.

 Although the property is read-only, the returned object is live and allows the
 modification of its content.

 The collection returned includes implicit `<tbody>` elements. For
 example:


```html
<table>
  <tr>
    <td>cell one</td>
  </tr>
</table>
```


 The HTML DOM generated from the above HTML will have a `<tbody>` element
 even though the tags are not included in the source HTML.

Value
-----

A live `HTMLCollection`.

Examples
--------

This snippet gets the number of bodies in a table.


```js
mytable.tBodies.length;
```

Specifications
--------------

| Specification |
| --- |
| HTML Standard # dom-table-tbodies-dev |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* `HTMLCollection`
* `<tbody>`
HTMLTableElement: frame property
================================

**Deprecated:** This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

 The `HTMLTableElement` interface's **`frame`**
 property is a string that indicates which of the table's exterior borders should be
 drawn.

Value
-----

One of the following:

`void`

No sides. This is the default.

`"above"`

Top side

`"below"`

Bottom side

`"hsides"`

Top and bottom only

`"vsides"`

Right and left sides only

`"lhs"`

Left-hand side only

`"rhs"`

Right-hand side only

`"box"`

All four sides

`"border"`

All four sides

Examples
--------


```js
// Set the frame of TableA to 'border'
const t = document.getElementById("TableA");
t.frame = "border";
t.border = "2px";
```

Specifications
--------------

* W3C DOM 2 HTML Specification
Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
HTMLTableElement: cellSpacing property
======================================

**Deprecated:** This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

 While you should instead use the CSS
 `border-spacing` property, the obsolete `HTMLTableElement`
 interface's **`cellSpacing`** property represents the spacing
 around the individual `<th>` and `<td>` elements
 representing a table's cells. Any two cells are separated by the sum of the
 `cellSpacing` of each of the two cells.

Value
-----

 A string which is either a number of pixels (such as
 `"10"`) or a percentage value (like `"10%"`).

Examples
--------

This example sets cell spacing for a given table to 10 pixels.


```js
const t = document.getElementById("TableA");
t.cellSpacing = "10";
```

Specifications
--------------

* W3C DOM 2 HTML Specification *HTMLTableElement.cellSpacing*.
Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
HTMLTableElement: deleteTFoot() method
======================================

 The **`HTMLTableElement.deleteTFoot()`** method removes the
 `<tfoot>` element from a given `<table>`.

Syntax
------


```js
deleteTFoot()
```

### Parameters

None.

### Return value

None (`undefined`).

Examples
--------

This example uses JavaScript to delete a table's footer.

### HTML


```html
<table>
  <thead>
    <th>Name</th>
    <th>Score</th>
  </thead>
  <tr>
    <td>Bob</td>
    <td>541</td>
  </tr>
  <tr>
    <td>Jim</td>
    <td>225</td>
  </tr>
  <tfoot>
    <th>Average</th>
    <td>383</td>
  </tfoot>
</table>
```

### JavaScript


```js
let table = document.querySelector("table");
table.deleteTFoot();
```

### Result

Specifications
--------------

| Specification |
| --- |
| HTML Standard # dom-table-deletetfoot-dev |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
HTMLTableElement: rows property
===============================

 The read-only `HTMLTableElement`
 property **`rows`** returns a live
 `HTMLCollection` of all the rows in the table, including the rows
 contained within any `<thead>`, `<tfoot>`, and
 `<tbody>` elements.

 Although the property itself is read-only, the returned object is live and allows the
 modification of its content.

Value
-----

 An `HTMLCollection` providing a live-updating list of the
 `HTMLTableRowElement` objects representing all of the `<tr>`
 elements contained in the table. This provides quick access to all of the table rows,
 without having to manually search for them.

Examples
--------


```js
myrows = mytable.rows;
firstRow = mytable.rows[0];
lastRow = mytable.rows.item(mytable.rows.length - 1);
```


 This demonstrates how you can use both array syntax (line 2) and the
 `HTMLCollection.item()` method (line 3) to obtain individual rows in the
 table.

Specifications
--------------

| Specification |
| --- |
| HTML Standard # dom-table-rows-dev |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
HTMLTableElement: deleteCaption() method
========================================

 The **`HTMLTableElement.deleteCaption()`** method removes the
 `<caption>` element from a given `<table>`. If there is no
 `<caption>` element associated with the table, this method does
 nothing.

Syntax
------


```js
deleteCaption()
```

### Parameters

None.

### Return value

None (`undefined`).

Examples
--------

This example uses JavaScript to delete a table's caption.

### HTML


```html
<table>
  <caption>
    This caption will be deleted!
  </caption>
  <tr>
    <td>Cell 1.1</td>
    <td>Cell 1.2</td>
  </tr>
  <tr>
    <td>Cell 2.1</td>
    <td>Cell 2.2</td>
  </tr>
</table>
```

### JavaScript


```js
let table = document.querySelector("table");
table.deleteCaption();
```

### Result

Specifications
--------------

| Specification |
| --- |
| HTML Standard # dom-table-deletecaption-dev |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
HTMLTableElement: rules property
================================

**Deprecated:** This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

 The **`HTMLTableElement.rules`** property indicates which cell
 borders to render in the table.

Value
-----

One of the following:

`none`

No rules

`groups`

Lines between groups only

`rows`

Lines between rows

`cols`

Lines between cols

`all`

Lines between all cells

Examples
--------


```js
// Turn on all the internal borders of a table
const t = document.getElementById("TableID");
t.rules = "all";
```

Specifications
--------------

* W3C DOM 2 HTML Specification
Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
HTMLTableElement: align property
================================

**Deprecated:** This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

 The **`HTMLTableElement.align`** property represents the
 alignment of the table.

Value
-----

One of the following string values:

* `left`
* `center`
* `right`
Examples
--------


```js
// Set the alignment of a table
const t = document.getElementById("TableA");
t.align = "center";
```

Specifications
--------------

* W3C DOM 2 HTML Specification *HTMLTableElement.align*.
Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
HTMLTableElement: createCaption() method
========================================

 The **`HTMLTableElement.createCaption()`** method returns the
 `<caption>` element associated with a given `<table>`.
 If no `<caption>` element exists on the table, this method creates
 it, and then returns it.


**Note:** If no caption exists, `createCaption()` inserts a
 new caption directly into the table. The caption does not need to be added
 separately as would be the case if `Document.createElement()` had
 been used to create the new `<caption>` element.


Syntax
------


```js
createCaption()
```

### Parameters

None.

### Return value

`HTMLTableCaptionElement`Examples
--------

This example uses JavaScript to add a caption to a table that initially lacks one.

### HTML


```html
<table>
  <tr>
    <td>Cell 1.1</td>
    <td>Cell 1.2</td>
    <td>Cell 1.3</td>
  </tr>
  <tr>
    <td>Cell 2.1</td>
    <td>Cell 2.2</td>
    <td>Cell 2.3</td>
  </tr>
</table>
```

### JavaScript


```js
let table = document.querySelector("table");
let caption = table.createCaption();
caption.textContent = "This caption was created by JavaScript!";
```

### Result

Specifications
--------------

| Specification |
| --- |
| HTML Standard # dom-table-createcaption-dev |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
HTMLTableElement: createTBody() method
======================================

 The **`createTBody()`** method of
 `HTMLTableElement` objects creates and returns a new
 `<tbody>` element associated with a given `<table>`.


**Note:** Unlike `HTMLTableElement.createTHead()` and
 `HTMLTableElement.createTFoot()`, `createTBody()`
 systematically creates a new `<tbody>` element, even if the table
 already contains one or more bodies. If so, the new one is inserted after the existing
 ones.


Syntax
------


```js
createTBody()
```

### Parameters

None.

### Return value

`HTMLTableSectionElement`Examples
--------


```js
let mybody = mytable.createTBody();
// Now this should be true: mybody === mytable.tBodies.item(mytable.tBodies.length - 1)
```

Specifications
--------------

| Specification |
| --- |
| HTML Standard # dom-table-createtbody-dev |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
HTMLTableElement: width property
================================

**Deprecated:** This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

 The **`HTMLTableElement.width`** property represents the
 desired width of the table.

Value
-----

A string representing the width in number of pixels or as a percentage value.

Examples
--------


```js
mytable.width = "75%";
```

Specifications
--------------

* W3C DOM 2 HTML Specification *HTMLTableElement.width*
Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
HTMLTableElement: tFoot property
================================

 The **`HTMLTableElement.tFoot`** property represents the
 `<tfoot>` element of a `<table>`. Its value will be
 `null` if there is no such element.

Value
-----

A `<tfoot>` element or `null`.

Examples
--------


```js
if (table.tFoot === my_foot) {
  // …
}
```

Specifications
--------------

| Specification |
| --- |
| HTML Standard # dom-table-tfoot-dev |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* The interface implementing this property: `HTMLTableElement`.
HTMLTableElement: bgColor property
==================================

**Deprecated:** This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

 The **`bgcolor`** property of the `HTMLTableElement` represents the
 background color of the table.

**Note:** Do not use this attribute anymore. Instead, use the CSS `background-color` property by modifying the element's `style` attribute or using a style rule.

Value
-----

A string representing a color value.

Examples
--------


```js
// Set table background color to lightblue
const t = document.getElementById("TableA");
t.bgColor = "lightblue";
```

Specifications
--------------

| Specification |
| --- |
| HTML Standard # dom-table-bgcolor |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* `background-color`
HTMLTableElement: deleteTHead() method
======================================

 The **`HTMLTableElement.deleteTHead()`** removes the
 `<thead>` element from a given `<table>`.

Syntax
------


```js
deleteTHead()
```

### Parameters

None.

### Return value

None (`undefined`).

Examples
--------

This example uses JavaScript to delete a table's header.

### HTML


```html
<table>
  <thead>
    <th>Name</th>
    <th>Occupation</th>
  </thead>
  <tr>
    <td>Bob</td>
    <td>Plumber</td>
  </tr>
  <tr>
    <td>Jim</td>
    <td>Roofer</td>
  </tr>
</table>
```

### JavaScript


```js
let table = document.querySelector("table");
table.deleteTHead();
```

### Result

Specifications
--------------

| Specification |
| --- |
| HTML Standard # dom-table-deletethead-dev |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
TextTrackCue: exit event
========================

The **`exit`** event fires when a cue stops being active.

Syntax
------

Use the event name in methods like `addEventListener()`, or set an event handler property.


```js
addEventListener("exit", (event) => {});

onexit = (event) => {};
```

Event type
----------

A generic `Event` with no added properties.

Example
-------

In the following example, `cue1` prints to the console when it stops being displayed as the active cue.


```js
cue1.addEventListener("enter", (event) => {
  console.log("Cue 1 has left the building.");
});
```

Specifications
--------------

| Specification |
| --- |
| HTML Standard # event-media-exit |
| HTML Standard # handler-texttrackcue-onexit |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
TextTrackCue: pauseOnExit property
==================================

The **`pauseOnExit`** property of the `TextTrackCue` interface returns or sets the flag indicating whether playback of the media should pause when the end of the range to which this cue applies is reached.

Value
-----

A `Boolean`, true if the media will pause.

Examples
--------

Specifications
--------------

| Specification |
| --- |
| HTML Standard # dom-texttrackcue-pauseonexit |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
TextTrackCue: track property
============================

The **`track`** read-only property of the `TextTrackCue` interface returns the `TextTrack` object that this cue belongs to.

Value
-----

A `TextTrack` object.

Examples
--------

In the following example a new `VTTCue` (which inherits from `TextTrackCue`) is created, then added to a track. The value of `track` is printed to the console.


```js
let video = document.querySelector("video");
let captiontrack = video.addTextTrack("captions", "Captions", "en");
captiontrack.mode = "showing";

let cue1 = new VTTCue(0, 0.9, "Hildy!");
captiontrack.addCue(cue1);
console.log(cue1.track); // a TextTrack object.
```

Specifications
--------------

| Specification |
| --- |
| HTML Standard # dom-texttrackcue-track |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.