Class HTMLTableElement

All Implemented Interfaces:
Serializable, 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:
  • Constructor Details

    • HTMLTableElement

      public HTMLTableElement()
      Creates an instance.
  • Method Details

    • jsConstructor

      public void jsConstructor()
      JavaScript constructor.
      Overrides:
      jsConstructor in class HTMLElement
    • 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:
    • 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:
    • createTBody

      public 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:
    • 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:
    • 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:
    • 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:
    • 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:
    • 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 property.
      Returns:
      the width property
    • setWidth_js

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

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

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

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

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

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

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

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

      public void setBgColor(String bgColor)
      Sets the value of the bgColor property.
      Parameters:
      bgColor - the value of the bgColor property
      See Also:
    • appendChild

      public Object appendChild(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 Object removeChild(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 String getSummary()
      Gets the summary property.
      Returns:
      the property
    • setSummary

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

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

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