Name

TableSection — a header, footer, or body section of a table

Inherits from

Node, Element

Synopsis

A TableSection object represents a <tbody>, <thead>, or <tfoot> element in an HTML table. The tHead and tFoot properties of a Table are TableSection objects, and the tBodies property is an HTMLCollection of TableSection objects.

A TableSection contains TableRow objects and is contained in a Table object.

Properties

readonly HTMLCollection rows

An array-like object of TableRow objects representing the rows in this section of the table.

Methods

void deleteRow(long index)

This method deletes the row at the specified position within this section.

TableRow insertRow([long index])

This method creates a new <tr> element, inserts it into this table section at the specified position, and returns it. If index is -1 or is omitted or equals the number of rows currently in the section, the new row is appended to the end of the section. Otherwise, the new row is inserted immediately before the row that is currently at the position specified by index. Note that for this method, index specifies a row position within a single table section, not within the entire table.

Get JavaScript: The Definitive Guide, 6th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.