Class HTMLTableElement
- java.lang.Object
-
- org.htmlunit.corejs.javascript.ScriptableObject
-
- org.htmlunit.javascript.HtmlUnitScriptable
-
- org.htmlunit.javascript.host.event.EventTarget
-
- org.htmlunit.javascript.host.dom.Node
-
- org.htmlunit.javascript.host.Element
-
- org.htmlunit.javascript.host.html.HTMLElement
-
- org.htmlunit.javascript.host.html.RowContainer
-
- org.htmlunit.javascript.host.html.HTMLTableElement
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,org.htmlunit.corejs.javascript.ConstProperties
,org.htmlunit.corejs.javascript.debug.DebuggableObject
,org.htmlunit.corejs.javascript.Scriptable
,org.htmlunit.corejs.javascript.SymbolScriptable
public class HTMLTableElement extends RowContainer
The JavaScript objectHTMLTableElement
.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.htmlunit.javascript.host.html.HTMLElement
HTMLElement.ProxyDomNode
-
-
Field Summary
-
Fields inherited from class org.htmlunit.javascript.host.dom.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
-
-
Constructor Summary
Constructors Constructor Description HTMLTableElement()
Creates an instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
appendChild(java.lang.Object childObject)
Adds a DOM node to the node.java.lang.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.java.lang.Object
createTBody()
If this table does not have a tbody element, this method creates an empty tbody element, adds it to the table and then returns it.java.lang.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.java.lang.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.java.lang.String
getBgColor()
Returns the value of thebgColor
property.java.lang.String
getBorder()
Gets theborder
property.java.lang.Object
getCaption()
Returns the table's caption element, ornull
if none exists.java.lang.String
getCellPadding()
Returns thecellPadding
property.java.lang.String
getCellSpacing()
Returns thecellSpacing
property.java.lang.String
getRules()
Gets therules
property.java.lang.String
getSummary()
Gets thesummary
property.java.lang.Object
getTBodies()
Returns the tbody's in the table.java.lang.Object
getTFoot()
Returns the table's tfoot element, ornull
if none exists.java.lang.Object
getTHead()
Returns the table's thead element, ornull
if none exists.java.lang.String
getWidth_js()
Returns thewidth
property.java.lang.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
jsConstructor()
JavaScript constructor.java.lang.Object
removeChild(java.lang.Object childObject)
Removes a DOM node from this node.void
setBgColor(java.lang.String bgColor)
Sets the value of thebgColor
property.void
setBorder(java.lang.String border)
Sets theborder
property.void
setCaption(java.lang.Object o)
Sets the caption.void
setCellPadding(java.lang.String cellPadding)
Sets thecellPadding
property.void
setCellSpacing(java.lang.String cellSpacing)
Sets thecellSpacing
property.void
setRules(java.lang.String rules)
Sets therules
property.void
setSummary(java.lang.String summary)
Sets thesummary
property.void
setTFoot(java.lang.Object o)
Sets the tFoot.void
setTHead(java.lang.Object o)
Sets thetHead
.void
setWidth_js(java.lang.String width)
Sets thewidth
property.-
Methods inherited from class org.htmlunit.javascript.host.html.RowContainer
deleteRow, getAlign, getRows, insertRow, setAlign
-
Methods inherited from class org.htmlunit.javascript.host.html.HTMLElement
blur, click, focus, getAccessKey, getAlign, getAttributeNode, getAutofocus, getBoundingClientRect, getCh, getChOff, getContentEditable, getDataset, getDir, getDomNodeOrDie, getDomNodeOrNull, getEnterKeyHint, getForm, getInnerText, getLang, getLocalName, getName, getNodeName, getOffsetHeight, getOffsetLeft, getOffsetParent_js, getOffsetTop, getOffsetWidth, getOnabort, getOnanimationcancel, getOnanimationend, getOnanimationiteration, getOnanimationstart, getOnauxclick, getOnblur, getOncancel, getOncanplay, getOncanplaythrough, getOnchange, getOnclick, getOnclose, getOncontextmenu, getOncopy, getOncuechange, getOncut, getOndblclick, getOndrag, getOndragend, getOndragenter, getOndragleave, getOndragover, getOndragstart, getOndrop, getOndurationchange, getOnemptied, getOnended, getOnerror, getOnfocus, getOngotpointercapture, getOninput, getOninvalid, getOnkeydown, getOnkeypress, getOnkeyup, getOnload, getOnloadeddata, getOnloadedmetadata, getOnloadstart, getOnlostpointercapture, getOnmousedown, getOnmouseenter, getOnmouseleave, getOnmousemove, getOnmouseout, getOnmouseover, getOnmouseup, getOnmousewheel, getOnmozfullscreenchange, getOnmozfullscreenerror, getOnpaste, getOnpause, getOnplay, getOnplaying, getOnpointercancel, getOnpointerdown, getOnpointerenter, getOnpointerleave, getOnpointermove, getOnpointerout, getOnpointerover, getOnpointerup, getOnprogress, getOnratechange, getOnreset, getOnresize, getOnscroll, getOnscrollend, getOnseeked, getOnseeking, getOnselect, getOnselectionchange, getOnselectstart, getOnstalled, getOnsubmit, getOnsuspend, getOntimeupdate, getOntoggle, getOntransitioncancel, getOntransitionend, getOntransitionrun, getOntransitionstart, getOnvolumechange, getOnwaiting, getOnwheel, getOuterText, getParentHTMLElement, getPosX, getPosY, getPrefix, getStyle, getTabIndex, getTitle, getVAlign, getValue, getWidthOrHeight, isAncestorOfEventTarget, isDisabled, isEndTagForbidden, isHidden, isIsContentEditable, isLowerCaseInOuterHtml, isSpellcheck, setAccessKey, setAlign, setAttribute, setAutofocus, setCh, setChOff, setColorAttribute, setContentEditable, setDir, setDisabled, setDomNode, setEnterKeyHint, setHidden, setInnerText, setLang, setName, setOnabort, setOnanimationcancel, setOnanimationend, setOnanimationiteration, setOnanimationstart, setOnauxclick, setOnblur, setOncancel, setOncanplay, setOncanplaythrough, setOnchange, setOnclick, setOnclose, setOncontextmenu, setOncopy, setOncuechange, setOncut, setOndblclick, setOndrag, setOndragend, setOndragenter, setOndragleave, setOndragover, setOndragstart, setOndrop, setOndurationchange, setOnemptied, setOnended, setOnerror, setOnfocus, setOngotpointercapture, setOninput, setOninvalid, setOnkeydown, setOnkeypress, setOnkeyup, setOnload, setOnloadeddata, setOnloadedmetadata, setOnloadstart, setOnlostpointercapture, setOnmousedown, setOnmouseenter, setOnmouseleave, setOnmousemove, setOnmouseout, setOnmouseover, setOnmouseup, setOnmousewheel, setOnmozfullscreenchange, setOnmozfullscreenerror, setOnpaste, setOnpause, setOnplay, setOnplaying, setOnpointercancel, setOnpointerdown, setOnpointerenter, setOnpointerleave, setOnpointermove, setOnpointerout, setOnpointerover, setOnpointerup, setOnprogress, setOnratechange, setOnreset, setOnresize, setOnscroll, setOnscrollend, setOnseeked, setOnseeking, setOnselect, setOnselectionchange, setOnselectstart, setOnstalled, setOnsubmit, setOnsuspend, setOntimeupdate, setOntoggle, setOntransitioncancel, setOntransitionend, setOntransitionrun, setOntransitionstart, setOnvolumechange, setOnwaiting, setOnwheel, setOuterText, setSpellcheck, setStyle, setTabIndex, setTextContent, setTitle, setVAlign, setValue, setWidthOrHeight, toString
-
Methods inherited from class org.htmlunit.javascript.host.Element
after, append, before, closest, createAttributesObject, createEventHandler, getAttribute, getAttributeNodeNS, getAttributeNS, getAttributes, getChildElementCount, getChildren, getClassList, getClassName_js, getClientHeight, getClientLeft, getClientRects, getClientTop, getClientWidth, getElementsByClassName, getElementsByTagName, getElementsByTagNameNS, getFirstElementChild, getId, getInnerHTML, getInnerHTML, getLastElementChild, getNamespaceURI, getNextElementSibling, getOnbeforecopy, getOnbeforecut, getOnbeforepaste, getOnsearch, getOnwebkitfullscreenchange, getOnwebkitfullscreenerror, getOuterHTML, getParentElement, getPreviousElementSibling, getScrollHeight, getScrollLeft, getScrollTop, getScrollWidth, getTagName, hasAttribute, hasAttributeNS, hasAttributes, innerHTML, insertAdjacentElement, insertAdjacentHTML, insertAdjacentText, isDisplayNone, matches, mozMatchesSelector, prepend, printChildren, printNode, querySelector, querySelectorAll, releaseCapture, remove, removeAttribute, removeAttributeNode, removeAttributeNS, replaceChildren, replaceWith, scroll, scrollBy, scrollIntoView, scrollIntoViewIfNeeded, scrollTo, setAttributeNode, setAttributeNS, setCapture, setClassName_js, setId, setInnerHTML, setOnbeforecopy, setOnbeforecut, setOnbeforepaste, setOnsearch, setOnwebkitfullscreenchange, setOnwebkitfullscreenerror, setOuterHTML, setScrollLeft, setScrollTop, toggleAttribute, webkitMatchesSelector
-
Methods inherited from class org.htmlunit.javascript.host.dom.Node
after, append, before, cloneNode, compareDocumentPosition, contains, getBaseURI, getChildNodes, getFirstChild, getJavaScriptNode, getLastChild, getNextSibling, getNodeType, getNodeValue, getOwnerDocument, getParent, getParentNode, getPreviousSibling, getRootNode, getTextContent, hasChildNodes, insertBefore, insertBeforeImpl, isEqualNode, isSameNode, normalize, prepend, replaceChild, replaceChildren, replaceWith, setNodeValue
-
Methods inherited from class org.htmlunit.javascript.host.event.EventTarget
addEventListener, clearEventListenersContainer, dispatchEvent, executeEventLocally, fireEvent, getEventHandler, getEventListenersContainer, hasEventHandlers, isEventHandlerOnWindow, removeEventListener, setEventHandler
-
Methods inherited from class org.htmlunit.javascript.HtmlUnitScriptable
clone, equivalentValues, get, getBrowserVersion, getClassName, getDefaultValue, getPrototype, getScriptableFor, getStartingScope, getWindow, getWindow, getWithPreemption, has, hasInstance, initParentScope, makeScriptableFor, put, setClassName, setDomNode, setParentScope, setupPromise, setupRejectedPromise
-
Methods inherited from class org.htmlunit.corejs.javascript.ScriptableObject
applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkPropertyChange, checkPropertyDefinition, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineOwnProperties, defineOwnProperty, defineOwnProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, delete, delete, delete, deleteProperty, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, ensureSymbolScriptable, get, get, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getExternalArrayData, getExternalArrayLength, getFunctionPrototype, getGeneratorFunctionPrototype, getGetterOrSetter, getGetterOrSetter, getIds, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getProperty, getPropertyIds, getPrototype, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, has, has, hasProperty, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, preventExtensions, put, put, putConst, putConstProperty, putProperty, putProperty, putProperty, querySlot, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setAttributes, setCommonDescriptorProperties, setExternalArrayData, setGetterOrSetter, setPrototype, size
-
-
-
-
Method Detail
-
jsConstructor
public void jsConstructor()
JavaScript constructor.- Overrides:
jsConstructor
in classHTMLElement
-
getCaption
public java.lang.Object getCaption()
Returns the table's caption element, ornull
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(java.lang.Object o)
Sets the caption.- Parameters:
o
- the caption
-
getTFoot
public java.lang.Object getTFoot()
Returns the table's tfoot element, ornull
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(java.lang.Object o)
Sets the tFoot.- Parameters:
o
- the tFoot
-
getTHead
public java.lang.Object getTHead()
Returns the table's thead element, ornull
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(java.lang.Object o)
Sets thetHead
.- Parameters:
o
- thetHead
-
getTBodies
public java.lang.Object getTBodies()
Returns the tbody's in the table.- Returns:
- the tbody's in the table
-
createCaption
public java.lang.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 java.lang.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
-
createTBody
public java.lang.Object createTBody()
If this table does not have a tbody element, this method creates an empty tbody element, adds it to the table and then returns it. If this table already has a tbody element, this method returns the existing tbody element.- Returns:
- a newly added caption if no caption exists, or the first existing caption
- See Also:
- MSDN Documentation
-
createTHead
public java.lang.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
-
isContainedRow
protected boolean isContainedRow(HtmlTableRow row)
Indicates if the row belongs to this container.- Overrides:
isContainedRow
in classRowContainer
- Parameters:
row
- the row to test- Returns:
true
if it belongs to this container
-
insertRow
public java.lang.Object insertRow(int index)
Handle special case where table is empty. Inserts a new row at the given position.- Overrides:
insertRow
in classRowContainer
- Parameters:
index
- the index where the row should be inserted (0 <= index <= nbRows)- Returns:
- the inserted row
-
getWidth_js
public java.lang.String getWidth_js()
Returns thewidth
property.- Returns:
- the
width
property
-
setWidth_js
public void setWidth_js(java.lang.String width)
Sets thewidth
property.- Parameters:
width
- thewidth
property
-
getCellSpacing
public java.lang.String getCellSpacing()
Returns thecellSpacing
property.- Returns:
- the
cellSpacing
property
-
setCellSpacing
public void setCellSpacing(java.lang.String cellSpacing)
Sets thecellSpacing
property.- Parameters:
cellSpacing
- thecellSpacing
property
-
getCellPadding
public java.lang.String getCellPadding()
Returns thecellPadding
property.- Returns:
- the
cellPadding
property
-
setCellPadding
public void setCellPadding(java.lang.String cellPadding)
Sets thecellPadding
property.- Parameters:
cellPadding
- thecellPadding
property
-
getBorder
public java.lang.String getBorder()
Gets theborder
property.- Returns:
- the
border
property
-
setBorder
public void setBorder(java.lang.String border)
Sets theborder
property.- Parameters:
border
- theborder
property
-
getBgColor
public java.lang.String getBgColor()
Returns the value of thebgColor
property.- Returns:
- the value of the
bgColor
property - See Also:
- MSDN Documentation
-
setBgColor
public void setBgColor(java.lang.String bgColor)
Sets the value of thebgColor
property.- Parameters:
bgColor
- the value of thebgColor
property- See Also:
- MSDN Documentation
-
appendChild
public java.lang.Object appendChild(java.lang.Object childObject)
Adds a DOM node to the node.- Overrides:
appendChild
in classNode
- Parameters:
childObject
- the node to add to this node- Returns:
- the newly added child node
-
removeChild
public java.lang.Object removeChild(java.lang.Object childObject)
Removes a DOM node from this node.- Overrides:
removeChild
in classNode
- Parameters:
childObject
- the node to remove from this node- Returns:
- the removed child node
-
getSummary
public java.lang.String getSummary()
Gets thesummary
property.- Returns:
- the property
-
setSummary
public void setSummary(java.lang.String summary)
Sets thesummary
property.- Parameters:
summary
- the new property
-
getRules
public java.lang.String getRules()
Gets therules
property.- Returns:
- the property
-
setRules
public void setRules(java.lang.String rules)
Sets therules
property.- Parameters:
rules
- the new property
-
-