FileDocCategorySizeDatePackage
HTMLTableElement.javaAPI DocJava SE 5 API6594Fri Aug 26 14:58:40 BST 2005org.w3c.dom.html

HTMLTableElement

public interface HTMLTableElement implements HTMLElement
The create* and delete* methods on the table allow authors to construct and modify tables. HTML 4.0 specifies that only one of each of the CAPTION , THEAD , and TFOOT elements may exist in a table. Therefore, if one exists, and the createTHead() or createTFoot() method is called, the method returns the existing THead or TFoot element. See the TABLE element definition in HTML 4.0.

See also the Document Object Model (DOM) Level 2 Specification.

Fields Summary
Constructors Summary
Methods Summary
public org.w3c.dom.html.HTMLElementcreateCaption()
Create a new table caption object or return an existing one.

return
A CAPTION element.

public org.w3c.dom.html.HTMLElementcreateTFoot()
Create a table footer row or return an existing one.

return
A footer element (TFOOT ).

public org.w3c.dom.html.HTMLElementcreateTHead()
Create a table header row or return an existing one.

return
A new table header element (THEAD ).

public voiddeleteCaption()
Delete the table caption, if one exists.

public voiddeleteRow(int index)
Delete a table row.

param
index The index of the row to be deleted. This index starts from 0 and is relative to all the rows contained inside the table, regardless of section parentage.
exception
DOMException INDEX_SIZE_ERR: Raised if the specified index is greater than or equal to the number of rows or if the index is negative.

public voiddeleteTFoot()
Delete the footer from the table, if one exists.

public voiddeleteTHead()
Delete the header from the table, if one exists.

public java.lang.StringgetAlign()
Specifies the table's position with respect to the rest of the document. See the align attribute definition in HTML 4.0. This attribute is deprecated in HTML 4.0.

public java.lang.StringgetBgColor()
Cell background color. See the bgcolor attribute definition in HTML 4.0. This attribute is deprecated in HTML 4.0.

public java.lang.StringgetBorder()
The width of the border around the table. See the border attribute definition in HTML 4.0.

public org.w3c.dom.html.HTMLTableCaptionElementgetCaption()
Returns the table's CAPTION , or void if none exists.

public java.lang.StringgetCellPadding()
Specifies the horizontal and vertical space between cell content and cell borders. See the cellpadding attribute definition in HTML 4.0.

public java.lang.StringgetCellSpacing()
Specifies the horizontal and vertical separation between cells. See the cellspacing attribute definition in HTML 4.0.

public java.lang.StringgetFrame()
Specifies which external table borders to render. See the frame attribute definition in HTML 4.0.

public org.w3c.dom.html.HTMLCollectiongetRows()
Returns a collection of all the rows in the table, including all in THEAD , TFOOT , all TBODY elements.

public java.lang.StringgetRules()
Specifies which internal table borders to render. See the rules attribute definition in HTML 4.0.

public java.lang.StringgetSummary()
Description about the purpose or structure of a table. See the summary attribute definition in HTML 4.0.

public org.w3c.dom.html.HTMLCollectiongetTBodies()
Returns a collection of the defined table bodies.

public org.w3c.dom.html.HTMLTableSectionElementgetTFoot()
Returns the table's TFOOT , or null if none exists.

public org.w3c.dom.html.HTMLTableSectionElementgetTHead()
Returns the table's THEAD , or null if none exists.

public java.lang.StringgetWidth()
Specifies the desired table width. See the width attribute definition in HTML 4.0.

public org.w3c.dom.html.HTMLElementinsertRow(int index)
Insert a new empty row in the table. The new row is inserted immediately before and in the same section as the current index th row in the table. If index is equal to the number of rows, the new row is appended. In addition, when the table is empty the row is inserted into a TBODY which is created and inserted into the table. Note. A table row cannot be empty according to HTML 4.0 Recommendation.

param
index The row number where to insert a new row. This index starts from 0 and is relative to all the rows contained inside the table, regardless of section parentage.
return
The newly created row.
exception
DOMException INDEX_SIZE_ERR: Raised if the specified index is greater than the number of rows or if the index is negative.

public voidsetAlign(java.lang.String align)

public voidsetBgColor(java.lang.String bgColor)

public voidsetBorder(java.lang.String border)

public voidsetCaption(org.w3c.dom.html.HTMLTableCaptionElement caption)

public voidsetCellPadding(java.lang.String cellPadding)

public voidsetCellSpacing(java.lang.String cellSpacing)

public voidsetFrame(java.lang.String frame)

public voidsetRules(java.lang.String rules)

public voidsetSummary(java.lang.String summary)

public voidsetTFoot(org.w3c.dom.html.HTMLTableSectionElement tFoot)

public voidsetTHead(org.w3c.dom.html.HTMLTableSectionElement tHead)

public voidsetWidth(java.lang.String width)