Hello,
Some specific HTML Extended contents such as phpdocx_footnote and phpdocx_endnote doesn't allow being wrapped by other block contents (such as div or tables).
We always recommend adding them as the root of the HTML Extended contents, but if you need to wrap them you can use a p tag:
$html = '
<p>
<p>Text</p>
<phpdocx_footnote>
<p>Here <span class="italicc">comes</strong> the </p>
<phpdocx_footnote_textdocument data-text=" footnote" />
<phpdocx_footnote_textfootnote>
<p>Text <em>footnote</em></p>
</phpdocx_footnote_textfootnote>
<p> and some other text.</p>
</phpdocx_footnote>
<p>Text</p>
<table border="0" width="100%">
<tr valign="top">
<td width="50%"></td>
<td width="50%">
<p>Text</p>
</td>
</tr>
</table>
<p>Text</p>
</p>
';
$docx->embedHTML($html, array('useHTMLExtended' => true));
or a custom tag:
$html = '
<element>
<p>Text</p>
<phpdocx_footnote>
<p>Here <span class="italicc">comes</strong> the </p>
<phpdocx_footnote_textdocument data-text=" footnote" />
<phpdocx_footnote_textfootnote>
<p>Text <em>footnote</em></p>
</phpdocx_footnote_textfootnote>
<p> and some other text.</p>
</phpdocx_footnote>
<p>Text</p>
<table border="0" width="100%">
<tr valign="top">
<td width="50%"></td>
<td width="50%">
<p>Text</p>
</td>
</tr>
</table>
<p>Text</p>
</element>
';
$docx->embedHTML($html, array('useHTMLExtended' => true));
We move the request to the dev team to add support of wrapping that specific contents in divs and other block contents.
Regards.