Forum


Replies: 1   Views: 330
Odd behavior with embedhtml and ul
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 admin  · 27-11-2018 - 15:00

Edited by admin · 27-11-2018 - 15:17

Hello,

Some CSS styles are inherited. We recommend you to set explicit styles to overwrite inherited styles.

We have also run the following code:

$html = '<table border="1" style="border-collapse: collapse" width="600">
            <tbody>
                <tr width="600">
                    <td style="background-color: yellow"><ul><li>Item A</li><li>Item B</li></ul></td>
                    <td rowspan="3" colspan="2">1_2</td>
                </tr>
                <tr width="600">
                    <td>Some random text.</td>
                </tr>
                <tr width="600">
                    <td>
                        <ul>
                            <li>One</li>
                            <li>Two <b>and a half</b></li>
                        </ul>
                    </td>
                </tr>
                <tr width="600">
                    <td>3_2</td>
                    <td>3_3</td>
                    <td>3_3</td>
                </tr>
            </tbody>
        </table>';
$docx->embedHTML($html);

that includes a cell with a background and a list and the output is correct. We have tested the output with all versions of MS Word and LibreOffice; please note that OpenOffice has limitations when opening DOCX documents.

Regards.