HTMLTableElement Interface
The HTMLTableElement represents a table.
IDL Definition
Interface HTMLTableElement : HTMLElement {
attribute HTMLTableCaptionElement caption;
attribute HTMLTableSectionElement tHead;
attribute HTMLTableSectionElement tFoot;
readonly attribute HTMLCollection rows;
readonly attribute HTMLCollection tBodies;
attribute DOMString align;
attribute DOMString bgColor;
attribute DOMString border;
attribute DOMString cellPadding;
attribute DOMString cellSpacing;
attribute DOMString frame;
attribute DOMString rules;
attribute DOMString summary;
attribute DOMString width;
HTMLElement createTHead();
void deleteTHead();
HTMLElement createTFoot();
void deleteTFoot();
HTMLElement insertRow(in long index);
void deleteRow(in long index);
};
Semantic Requirements
- The caption attribute returns the table's CAPTION.
- The caption attribute returns null if there is no table CAPTION.
- The tHead attribute returns the table's THEAD.
- The tHead attribute returns null if there is no table THEAD.
- The tFoot attribute returns the table's TFOOT.
- The tFoot attribute returns null if there is no table TFOOT.
- The rows attribute returns a collection of all the rows in the table, including all in THEAD, TFOOT, and TBODY elements.
- The tBodies attribute returns a collection of the defined table contents.
- The align attribute specifies the table's position with respect to the rest of the document.
- The bgColor attribute contains the cell's background color.
- The border attribute contains the width of the border around the table.
- The cellPadding attribute specifies the horizontal and vertical space between cell content and cell borders.
- The cellSpacing attribute specifies the horizontal and vertical separation between cells.
- The frame attribute specifies which external table borders to render.
- The rules attribute specifies which internal table borders to render.
- The summary attribute is a supplementary description about the purpose or structure of a table.
- The width attribute specifies the desired table width.
Methods
- The createTHead method creates a table header or return an existing one.
- The createTHead() method returns a new table header (THEAD).
- The deleteTHead() method delete the header from the table, if one exists.
- The createTFoot() method creates a table header footer row or return an
existing one.
- The createTFoot() method returns a footer element (TFOOT).
- The deleteFoot() method deletes the footer from the table.
- The createCaption() method creates a new table caption object or returns an existing one.
- The createCaption() method returns a CAPTION element.
- The deleteCaption() method delete the table caption.
- The insertRow(index) method insert a new empty row in the table specified by the index parameter.
- The deleteRow(index) method delete a table row specified by the index parameter.
If you have comments or suggestions, email me at mbrady@nist.gov