com.gargoylesoftware.htmlunit.javascript.host.html
Class HTMLTableElement

java.lang.Object
  extended by net.sourceforge.htmlunit.corejs.javascript.ScriptableObject
      extended by com.gargoylesoftware.htmlunit.javascript.SimpleScriptable
          extended by com.gargoylesoftware.htmlunit.javascript.host.Node
              extended by com.gargoylesoftware.htmlunit.javascript.host.EventNode
                  extended by com.gargoylesoftware.htmlunit.javascript.host.Element
                      extended by com.gargoylesoftware.htmlunit.javascript.host.html.HTMLElement
                          extended by com.gargoylesoftware.htmlunit.javascript.host.RowContainer
                              extended by com.gargoylesoftware.htmlunit.javascript.host.html.HTMLTableElement
All Implemented Interfaces:
ScriptableWithFallbackGetter, Serializable, Cloneable, net.sourceforge.htmlunit.corejs.javascript.ConstProperties, net.sourceforge.htmlunit.corejs.javascript.debug.DebuggableObject, net.sourceforge.htmlunit.corejs.javascript.Scriptable

public class HTMLTableElement
extends RowContainer

A JavaScript object representing a Table.

Version:
$Revision: 8931 $
Author:
David D. Kilzer, Mike Bowler, Daniel Gredler, Chris Erskine, Marc Guillemot, Ahmed Ashour, Ronald Brill, Frank Danek
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.gargoylesoftware.htmlunit.javascript.host.html.HTMLElement
HTMLElement.ProxyDomNode
 
Field Summary
 
Fields inherited from class com.gargoylesoftware.htmlunit.javascript.host.html.HTMLElement
BEHAVIOR_ID_CLIENT_CAPS, BEHAVIOR_ID_DOWNLOAD, BEHAVIOR_ID_HOMEPAGE
 
Fields inherited from class com.gargoylesoftware.htmlunit.javascript.host.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
 
Fields inherited from class net.sourceforge.htmlunit.corejs.javascript.ScriptableObject
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST
 
Fields inherited from interface net.sourceforge.htmlunit.corejs.javascript.Scriptable
NOT_FOUND
 
Constructor Summary
HTMLTableElement()
           
 
Method Summary
 Object createCaption()
          If this table does not have a caption, this method creates an empty table caption, adds it to the table and then returns it.
 Object createTFoot()
          If this table does not have a tfoot element, this method creates an empty tfoot element, adds it to the table and then returns it.
 Object createTHead()
          If this table does not have a thead element, this method creates an empty thead element, adds it to the table and then returns it.
 void deleteCaption()
          Deletes this table's caption.
 void deleteTFoot()
          Deletes this table's tfoot element.
 void deleteTHead()
          Deletes this table's thead element.
 String getBgColor()
          Returns the value of the bgColor attribute.
 String getBorder()
          Gets the border attribute.
 Object getCaption()
          Returns the table's caption element, or null if none exists.
 String getCellPadding()
          Returns the cellPadding attribute.
 String getCellSpacing()
          Returns the cellSpacing attribute.
 Object getTBodies()
          Returns the tbody's in the table.
 Object getTFoot()
          Returns the table's tfoot element, or null if none exists.
 Object getTHead()
          Returns the table's thead element, or null if none exists.
 String getWidth_js()
          Returns the width attribute.
 Object insertRow(int index)
          Handle special case where table is empty.
protected  boolean isContainedRow(HtmlTableRow row)
          Indicates if the row belongs to this container.
 void refresh()
          Refreshes the content of this table.
 void setBgColor(String bgColor)
          Sets the value of the bgColor attribute.
 void setBorder(String border)
          Sets the border attribute.
 void setCaption(Object o)
          Sets the caption.
 void setCellPadding(String cellPadding)
          Sets the cellPadding attribute.
 void setCellSpacing(String cellSpacing)
          Sets the cellSpacing attribute.
 void setInnerHTML(Object value)
          Overwritten to throw an exception in IE8/9.
protected  void setInnerTextImpl(String value)
          Overwritten to throw an exception because this is readonly.
 void setTFoot(Object o)
          Sets the tFoot.
 void setTHead(Object o)
          Sets the tHead.
 void setWidth(String width)
          Sets the width attribute.
 
Methods inherited from class com.gargoylesoftware.htmlunit.javascript.host.RowContainer
deleteRow, getAlign, getRows, insertRow, moveRow, setAlign
 
Methods inherited from class com.gargoylesoftware.htmlunit.javascript.host.html.HTMLElement
addBehavior, addComponentRequest, blur, clearAttributes, clearComponentRequest, click, compareVersions, createEventHandler, createTextRange, dispatchEvent, doComponentRequest, doScroll, fixAttributeName, focus, get, getAccessKey, getAlign, getAll, getAttribute, getAttributeNode, getAttributeNodeNS, getAvailHeight, getAvailWidth, getBoundingClientRect, getBoxObject, getBufferDepth, getCh, getChildren, getChOff, getClassList, getClassName_js, getClientHeight, getClientLeft, getClientRects, getClientTop, getClientWidth, getColorDepth, getComponentVersion, getConnectionType, getCookieEnabled, getCpuClass, getDataset, getDefaultStyleDisplay, getDir, getDisabled, getDocument, getDomNodeOrDie, getDomNodeOrNull, getElementsByClassName, getFilters, getHeight, getId, getInnerHTML, getInnerText, getJavaEnabled, getLang, getLanguage, getLocalName, getNodeName, getOffsetHeight, getOffsetLeft, getOffsetParent_js, getOffsetTop, getOffsetWidth, getOnchange, getOnsubmit, getOuterHTML, getParentElement, getParentHTMLElement, getPlatform, getPosX, getPosY, getPrefix, getScopeName, getScrollHeight, getScrollLeft, getScrollTop, getScrollWidth, getSpellcheck, getSystemLanguage, getTabIndex, getTagName, getTagUrn, getTitle, getUniqueID, getUserLanguage, getVAlign, getWidth, getWidthOrHeight, getWithFallback, hasAttribute, insertAdjacentElement, insertAdjacentHTML, insertAdjacentText, isAncestorOfEventTarget, isAttributeName, isComponentInstalled, isEndTagForbidden, isHomePage, isLowerCaseInOuterHtml, mergeAttributes, navigateHomePage, parseHtmlSnippet, querySelector, querySelectorAll, readAttributes, removeAttributeNode, removeBehavior, removeExpression, removeNode, scrollIntoView, setAccessKey, setActive, setAlign, setAttribute, setCh, setChOff, setClassName, setColorAttribute, setDir, setDisabled, setDomNode, setExpression, setHomePage, setId, setInnerText, setLang, setLanguage, setOnchange, setOnsubmit, setOuterHTML, setScrollLeft, setScrollTop, setSpellcheck, setTabIndex, setTagUrn, setTextContent, setTitle, setVAlign, setWidthOrHeight, startDownload, toString
 
Methods inherited from class com.gargoylesoftware.htmlunit.javascript.host.Element
createAttributesObject, getAttributeNS, getAttributes, getBaseURI, getChildElementCount, getCurrentStyle, getElementsByTagName, getElementsByTagNameNS, getFirstElementChild, getLastElementChild, getNextElementSibling, getPreviousElementSibling, getRuntimeStyle, getStyle, getText, hasAttributeNS, removeAttribute, removeAttributeNS, selectNodes, selectSingleNode, setAttributeNode, setAttributeNS, setDefaults
 
Methods inherited from class com.gargoylesoftware.htmlunit.javascript.host.EventNode
fireEvent, getOnblur, getOnclick, getOncontextmenu, getOndblclick, getOnerror, getOnfocus, getOnfocusin, getOnfocusout, getOnkeydown, getOnkeypress, getOnkeyup, getOnmousedown, getOnmousemove, getOnmouseout, getOnmouseover, getOnmouseup, getOnpropertychange, getOnresize, setOnblur, setOnclick, setOncontextmenu, setOndblclick, setOnerror, setOnfocus, setOnfocusin, setOnfocusout, setOnkeydown, setOnkeypress, setOnkeyup, setOnmousedown, setOnmousemove, setOnmouseout, setOnmouseover, setOnmouseup, setOnpropertychange, setOnresize
 
Methods inherited from class com.gargoylesoftware.htmlunit.javascript.host.Node
addEventListener, appendChild, asJavaScriptException, attachEvent, cloneNode, compareDocumentPosition, contains, detachEvent, executeEvent, fireEvent, fireEvent, getBaseName, getChildNodes, getEventHandler, getEventHandlerProp, getFirstChild, getJavaScriptNode, getLastChild, getNamespaceURI, getNextSibling, getNodeType, getNodeValue, getOwnerDocument, getParent, getParentNode, getPreviousSibling, getTextContent, getXml, hasChildNodes, hasEventHandlers, insertBefore, insertBeforeImpl, isSameNode, normalize, removeChild, removeEventListener, replaceChild, setEventHandler, setEventHandlerProp, setNodeValue
 
Methods inherited from class com.gargoylesoftware.htmlunit.javascript.SimpleScriptable
clone, defineFunctionProperties, defineProperty, equivalentValues, getBrowserVersion, getClassName, getDefaultValue, getPrototype, getScriptableFor, getStartingScope, getTransformerScriptableFor, getWindow, getWindow, getWithPreemption, hasInstance, initParentScope, isReadOnlySettable, makeScriptableFor, setCaseSensitive, setDomNode, setHtmlElement, setParentScope
 
Methods inherited from class net.sourceforge.htmlunit.corejs.javascript.ScriptableObject
applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkPropertyChange, checkPropertyDefinition, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineOwnProperties, defineOwnProperty, defineOwnProperty, defineProperty, defineProperty, defineProperty, delete, delete, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, get, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getFunctionPrototype, getGetterOrSetter, getIds, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getSlot, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, has, has, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, preventExtensions, put, put, putConst, putConstProperty, putProperty, putProperty, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setGetterOrSetter, setPrototype, size
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface net.sourceforge.htmlunit.corejs.javascript.Scriptable
delete, delete, get, getClassName, getDefaultValue, getIds, getParentScope, getPrototype, has, has, hasInstance, put, put, setParentScope, setPrototype
 

Constructor Detail

HTMLTableElement

public HTMLTableElement()
Method Detail

getCaption

public Object getCaption()
Returns the table's caption element, or null if none exists. If more than one caption is declared in the table, this method returns the first one.

Returns:
the table's caption element

setCaption

public void setCaption(Object o)
Sets the caption.

Parameters:
o - the caption

getTFoot

public Object getTFoot()
Returns the table's tfoot element, or null if none exists. If more than one tfoot is declared in the table, this method returns the first one.

Returns:
the table's tfoot element

setTFoot

public void setTFoot(Object o)
Sets the tFoot.

Parameters:
o - the tFoot

getTHead

public Object getTHead()
Returns the table's thead element, or null if none exists. If more than one thead is declared in the table, this method returns the first one.

Returns:
the table's thead element

setTHead

public void setTHead(Object o)
Sets the tHead.

Parameters:
o - the tHead

getTBodies

public Object getTBodies()
Returns the tbody's in the table.

Returns:
the tbody's in the table

createCaption

public Object createCaption()
If this table does not have a caption, this method creates an empty table caption, adds it to the table and then returns it. If one or more captions already exist, this method returns the first existing caption.

Returns:
a newly added caption if no caption exists, or the first existing caption
See Also:
MSDN Documentation

createTFoot

public Object createTFoot()
If this table does not have a tfoot element, this method creates an empty tfoot element, adds it to the table and then returns it. If this table already has a tfoot element, this method returns the existing tfoot element.

Returns:
a newly added caption if no caption exists, or the first existing caption
See Also:
MSDN Documentation

createTHead

public Object createTHead()
If this table does not have a thead element, this method creates an empty thead element, adds it to the table and then returns it. If this table already has a thead element, this method returns the existing thead element.

Returns:
a newly added caption if no caption exists, or the first existing caption
See Also:
MSDN Documentation

deleteCaption

public void deleteCaption()
Deletes this table's caption. If the table has multiple captions, this method deletes only the first caption. If this table does not have any captions, this method does nothing.

See Also:
MSDN Documentation

deleteTFoot

public void deleteTFoot()
Deletes this table's tfoot element. If the table has multiple tfoot elements, this method deletes only the first tfoot element. If this table does not have any tfoot elements, this method does nothing.

See Also:
MSDN Documentation

deleteTHead

public void deleteTHead()
Deletes this table's thead element. If the table has multiple thead elements, this method deletes only the first thead element. If this table does not have any thead elements, this method does nothing.

See Also:
MSDN Documentation

refresh

public void refresh()
Refreshes the content of this table.

See Also:
MSDN Documentation

isContainedRow

protected boolean isContainedRow(HtmlTableRow row)
Indicates if the row belongs to this container.

Overrides:
isContainedRow in class RowContainer
Parameters:
row - the row to test
Returns:
true if it belongs to this container

insertRow

public Object insertRow(int index)
Handle special case where table is empty. Inserts a new row at the given position.

Overrides:
insertRow in class RowContainer
Parameters:
index - the index where the row should be inserted (0 <= index < nbRows)
Returns:
the inserted row

getWidth_js

public String getWidth_js()
Returns the width attribute.

Returns:
the width attribute

setWidth

public void setWidth(String width)
Sets the width attribute.

Parameters:
width - the width attribute

getCellSpacing

public String getCellSpacing()
Returns the cellSpacing attribute.

Returns:
the cellSpacing attribute

setCellSpacing

public void setCellSpacing(String cellSpacing)
Sets the cellSpacing attribute.

Parameters:
cellSpacing - the cellSpacing attribute

getCellPadding

public String getCellPadding()
Returns the cellPadding attribute.

Returns:
the cellPadding attribute

setCellPadding

public void setCellPadding(String cellPadding)
Sets the cellPadding attribute.

Parameters:
cellPadding - the cellPadding attribute

getBorder

public String getBorder()
Gets the border attribute.

Returns:
the border attribute

setBorder

public void setBorder(String border)
Sets the border attribute.

Parameters:
border - the border attribute

getBgColor

public String getBgColor()
Returns the value of the bgColor attribute.

Returns:
the value of the bgColor attribute
See Also:
MSDN Documentation

setBgColor

public void setBgColor(String bgColor)
Sets the value of the bgColor attribute.

Parameters:
bgColor - the value of the bgColor attribute
See Also:
MSDN Documentation

setInnerHTML

public void setInnerHTML(Object value)
Overwritten to throw an exception in IE8/9.

Overrides:
setInnerHTML in class HTMLElement
Parameters:
value - the new value for the contents of this node

setInnerTextImpl

protected void setInnerTextImpl(String value)
Overwritten to throw an exception because this is readonly.

Overrides:
setInnerTextImpl in class HTMLElement
Parameters:
value - the new value for the contents of this node


Copyright © 2002–2014 Gargoyle Software Inc.. All rights reserved.