Class 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 object HTMLTableElement.
    See Also:
    Serialized Form
    • Constructor Detail

      • HTMLTableElement

        public HTMLTableElement()
        Creates an instance.
    • Method Detail

      • getCaption

        public java.lang.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​(java.lang.Object o)
        Sets the caption.
        Parameters:
        o - the caption
      • getTFoot

        public java.lang.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​(java.lang.Object o)
        Sets the tFoot.
        Parameters:
        o - the tFoot
      • getTHead

        public java.lang.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​(java.lang.Object o)
        Sets the tHead.
        Parameters:
        o - the tHead
      • 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 class RowContainer
        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 class RowContainer
        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 the width property.
        Returns:
        the width property
      • setWidth_js

        public void setWidth_js​(java.lang.String width)
        Sets the width property.
        Parameters:
        width - the width property
      • getCellSpacing

        public java.lang.String getCellSpacing()
        Returns the cellSpacing property.
        Returns:
        the cellSpacing property
      • setCellSpacing

        public void setCellSpacing​(java.lang.String cellSpacing)
        Sets the cellSpacing property.
        Parameters:
        cellSpacing - the cellSpacing property
      • getCellPadding

        public java.lang.String getCellPadding()
        Returns the cellPadding property.
        Returns:
        the cellPadding property
      • setCellPadding

        public void setCellPadding​(java.lang.String cellPadding)
        Sets the cellPadding property.
        Parameters:
        cellPadding - the cellPadding property
      • getBorder

        public java.lang.String getBorder()
        Gets the border property.
        Returns:
        the border property
      • setBorder

        public void setBorder​(java.lang.String border)
        Sets the border property.
        Parameters:
        border - the border property
      • getBgColor

        public java.lang.String getBgColor()
        Returns the value of the bgColor property.
        Returns:
        the value of the bgColor property
        See Also:
        MSDN Documentation
      • setBgColor

        public void setBgColor​(java.lang.String bgColor)
        Sets the value of the bgColor property.
        Parameters:
        bgColor - the value of the bgColor 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 class Node
        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 class Node
        Parameters:
        childObject - the node to remove from this node
        Returns:
        the removed child node
      • getSummary

        public java.lang.String getSummary()
        Gets the summary property.
        Returns:
        the property
      • setSummary

        public void setSummary​(java.lang.String summary)
        Sets the summary property.
        Parameters:
        summary - the new property
      • getRules

        public java.lang.String getRules()
        Gets the rules property.
        Returns:
        the property
      • setRules

        public void setRules​(java.lang.String rules)
        Sets the rules property.
        Parameters:
        rules - the new property