Forum


Replies: 2   Views: 2030
Unable to insert footnote into the html-table
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by soglasie  · 30-07-2019 - 13:35

Hi!

We have strange issue while using embedHTML(): when we creating DOCX from HTML shown below

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <table>
        <tbody>
        <tr>
            <td>
                <phpdocx_footnote>
                    Some text here and ...
                    <phpdocx_footnote_textdocument data-text=" note" data-bold="false" />
                    <phpdocx_footnote_textfootnote>
                        <p>footnote data</p>
                    </phpdocx_footnote_textfootnote>
                </phpdocx_footnote>
            </td>
        </tr>
        </tbody>
    </table>
</body>
</html>

... using method embedHTML():

$options = [
    'isFile' => true,
    'baseURL' => dirname($url) . '/',
    'downloadImages' => true,
    'disableWrapValue' => true,
    'removeLineBreaks' => true,
    'useHTMLExtended' => true
];

$document = new CreateDocx();
$document->embedHTML($html, $options);
$structure = $document->createDocx('document_' . random_int(1, PHP_INT_MAX));
$structure->saveDocx('/path/to/root/' . $resource);

... we getting broken document (that document can`t be opened in MS Word).

How to properly insert into HTML-table footnote?