src/Element/HTML/HTMLTableElement.php
/**
     * Creates a new HTMLTableSectionElement and inserts it after the last tbody
     * element, if one exists, otherwise it is appended to the table and returns
     * the newly created tbody element.
     *
     * @see https://html.spec.whatwg.org/multipage/tables.html#dom-table-createtbody
     */
Creates a new HTMLTableSectionElement and inserts it after the last tbody
element, if one exists, otherwise it is appended to the table and returns
the newly created tbody element.


Creates a new HTMLTableSectionElement and inserts it after the last tbody element if one exists otherwise it is appended to the table and returns the newly created tbody element .
public function createTBody(): HTMLTableSectionElement
    {
        $node = $this->childNodes->last();
        $lastTbody = null;
        while ($node) {
            if ($node instanceof HTMLTableSectionElement && $node->localName === 'tbody') {
                $lastTbody = $node;
                break;
            }
            $node = $node->previousSibling;
        }
        $tbody = ElementFactory::create($this->nodeDocument, 'tbody', Namespaces::HTML);
        $child = null;
        if ($lastTbody) {
            $child = $lastTbody->nextSibling;
        }
        $this->insertNode($tbody, $child);
        return $tbody;
    }
public function createTBody ( ) : HTMLTableSectionElement { $ node = $ this -> childNodes -> last ( ) ; $ lastTbody = null ; while ( $ node ) { if ( $ node instanceof HTMLTableSectionElement && $ node -> localName === 'tbody' ) { $ lastTbody = $ node ; break ; } $ node = $ node -> previousSibling ; } $ tbody = ElementFactory :: create ( $ this -> nodeDocument , 'tbody' , Namespaces :: HTML ) ; $ child = null ; if ( $ lastTbody ) { $ child = $ lastTbody -> nextSibling ; } $ this -> insertNode ( $ tbody , $ child ) ; return $ tbody ; }
Creates a new HTMLTableSectionElement and inserts it after the last tbody
 element, if one exists, otherwise it is appended to the table and returns
 the newly created tbody element.
Creates a new HTMLTableSectionElement and inserts it after the last tbody element if one exists otherwise it is appended to the table and returns the newly created tbody element .