public void setBody(HTMLElement body) { Node html = getDocumentElement(); if (html == null) { html = createElement("html"); appendChild(html); } Node ref = getBody(); if (ref == null) { html.appendChild(body); } else { html.replaceChild(body, ref); } }
public HTMLElement insertRow(int index) { Node ref = getRow(index); Node row = getOwnerDocument().createElement("tr"); if (ref == null) { Node tbody = getChildElement("tbody"); if (tbody == null) { tbody = getOwnerDocument().createElement("tfoot"); appendChild(tbody); } tbody.appendChild(row); } else { ref.getParentNode().insertBefore(row, ref); } return (HTMLElement) row; }
public HTMLElement insertCell(int index) { Node ref = getCell(index); Node cell = getOwnerDocument().createElement("td"); if (ref == null) { appendChild(cell); } else { insertBefore(cell, ref); } return (HTMLElement) cell; }
public HTMLElement getBody() { Node html = getDocumentElement(); if (html != null) { Node body = getChildNodeByName(html, "body"); if (body == null) { body = getChildNodeByName(html, "frameset"); } return (HTMLElement) body; } return null; }
public HTMLElement createTHead() { HTMLTableSectionElement ref = getTHead(); if (ref == null) { return (HTMLElement) getOwnerDocument().createElement("thead"); } else { return ref; } }
public HTMLElement createTFoot() { HTMLTableSectionElement ref = getTFoot(); if (ref == null) { return (HTMLElement) getOwnerDocument().createElement("tfoot"); } else { return ref; } }
public HTMLElement createCaption() { HTMLTableCaptionElement ref = getCaption(); if (ref == null) { return (HTMLElement) getOwnerDocument().createElement("caption"); } else { return ref; } }
public HTMLElement insertRow(int index) { Node ref = getRow(index); Node row = getOwnerDocument().createElement("tr"); if (ref == null) { appendChild(row); } else { insertBefore(row, ref); } return (HTMLElement) row; }
public void add(HTMLElement element, HTMLElement before) { insertBefore(before, element); }