Forum


Replies: 1   Views: 2105
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 lucaloda  · 27-11-2018 - 14:13

if i insert an <ul> inside a <td> which has a background, the <ul> dots will have a colour as background that changes with the colour of the <td> background

Posted by admin  · 27-11-2018 - 15:00

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.