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

  1. The caption attribute returns the table's CAPTION.
  2. The caption attribute returns null if there is no table CAPTION.
  3. The tHead attribute returns the table's THEAD.
  4. The tHead attribute returns null if there is no table THEAD.
  5. The tFoot attribute returns the table's TFOOT.
  6. The tFoot attribute returns null if there is no table TFOOT.
  7. The rows attribute returns a collection of all the rows in the table, including all in THEAD, TFOOT, and TBODY elements.
  8. The tBodies attribute returns a collection of the defined table contents.
  9. The align attribute specifies the table's position with respect to the rest of the document.
  10. The bgColor attribute contains the cell's background color.
  11. The border attribute contains the width of the border around the table.
  12. The cellPadding attribute specifies the horizontal and vertical space between cell content and cell borders.
  13. The cellSpacing attribute specifies the horizontal and vertical separation between cells.
  14. The frame attribute specifies which external table borders to render.
  15. The rules attribute specifies which internal table borders to render.
  16. The summary attribute is a supplementary description about the purpose or structure of a table.
  17. The width attribute specifies the desired table width.
  18. Methods

  19. The createTHead method creates a table header or return an existing one.
  20. The createTHead() method returns a new table header (THEAD).
  21. The deleteTHead() method delete the header from the table, if one exists.
  22. The createTFoot() method creates a table header footer row or return an existing one.
  23. The createTFoot() method returns a footer element (TFOOT).
  24. The deleteFoot() method deletes the footer from the table.
  25. The createCaption() method creates a new table caption object or returns an existing one.
  26. The createCaption() method returns a CAPTION element.
  27. The deleteCaption() method delete the table caption.
  28. The insertRow(index) method insert a new empty row in the table specified by the index parameter.
  29. 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