A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://webplatform.github.io/docs/dom/HTMLTableElement/insertCell below:

insertCell ยท WebPlatform Docs

insertCell

Method of dom/HTMLTableElementdom/HTMLTableElement

Syntax
var object = object.insertCell(index);
Parameters index
Data-type
any

Integer that specifies where to insert the cell in the tr. The default value is -1, which appends the new cell to the end of the cells collection.

Return Value

Returns an object of type DOM NodeDOM Node

Object

Returns the td element object if successful, or null otherwise.

Examples

This example uses the insertCell method to add a cell to the end of the tr.

myNewCell = document.all.myTable.rows[0].insertCell()
Notes Remarks

The preferred technique for inserting a cell is to add the cell at the end of the cells collection. It is faster to add a cell at the end of a row than somewhere in the middle. To add a cell at the end of the collection, specify the -1 value, or the length of the cells collection minus 1.

Syntax Standards information Attributions

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4