2
<table>
<tr>
<th>Year</th>
<th>Score</th>
</tr>
<tr>
<td>2014</td>
<td>3078</td>
</tr>
</table>
위의 테이블을 변수로 성공적으로 저장 한 경우 오버플로 -x 스타일 속성이있는 div에 어떻게 추가 할 수 있습니까?DOMDocument 노드 두 개를 병합
$div = str_get_html('<div style="overflow-x:auto;"></div>');
$div = $div->find('div');
$div = $div->appendChild($table);
return $div;
그래서 예상 출력해야한다 :
<div style="overflow-x:auto;">
<table>
<tr>
<th>Year</th>
<th>Score</th>
</tr>
<tr>
<td>2014</td>
<td>3078</td>
</tr>
</table>
</div>
당신은 이전에 같은 질문을 게시하지 않았나요? – Barmar
@ D.Wells 예상 출력을 공유 할 수 있습니까? –
@Sahil 지금 질문에 추가했습니다. –