PHP:在DomDocument中插入标记

PHP:在DomDocument中插入标记,php,Php,我有以下html代码: <table> <tbody> <tr> <th >operatore</th> <td>3</td> <td>4</td> <td>5</td> <tr/> <tr> <th >operatore</th> <td>6<

我有以下html代码:

<table>
 <tbody>
  <tr>
   <th >operatore</th>
    <td>3</td>
    <td>4</td>
    <td>5</td>
  <tr/>
  <tr>
   <th >operatore</th>
    <td>6</td>
    <td>7</td>
    <td>8</td>
   <tr/>
 </tbody>
</table>

虽然我不能为其他人做任何事情,但我如何继续

谁说你不能?你有错误吗?您能告诉我们尝试的方法吗?您的意思是创建
(使用
createElement()
)和使用
appendChild()
将它们添加到
$thead
<thead>
    <tr>
        <th >Nome IT</th>
        <th >a</th>
        <th >b</th>
        <th >c</th>
    </tr>
</thead>
<table>
 <thead>
    <tr>
        <th >Nome IT</th>
        <th >a</th>
        <th >b</th>
        <th >c</th>
    </tr>
 </thead>
<tbody>
<tr>
.....
   $thead = $dom_ods->createElement("thead", "");
   $ods2_tmp->insertBefore($thead, $ods2_tmp->firstChild);
   $dom_ods->saveHTML();