Forum


Replies: 1   Views: 1901
Wrong lists rendering
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 rapidtech  · 09-12-2019 - 13:36

I'm experiencing a problem with the list rendering. The first inner "decimal" list (2-d level) becomes "Upper Alpha" like the last inner list (2-d level). This happens with the 3-d level and so on. Basically all the styles for the first inner list are overwritten by the last ones.

<?php

$docx = new CreateDocx();

$html = '
    <style>
        .list-decimal {list-style-type: decimal;}
        .list-upper-alpha {list-style-type: upper-alpha;}
        .list-upper-roman {list-style-type: upper-roman;}
    </style>
    <ol class="list-upper-roman">
        <li>UPPER ROMAN 1
            <ol class="list-decimal">
                <li>Decimal 1</li>
                <li>Decimal 2</li>
                <li>Decimal 3</li>
            </ol>
        </li>
        <li>UPPER ROMAN 2</li>
        <li>UPPER ROMAN 3</li>
        <li>UPPER ROMAN 4
            <ol class="list-upper-alpha">
                <li>UPPER ALPHA 1
                    <ol>
                        <li>Decimal 1</li>
                        <li>Decimal 2</li>
                        <li>Decimal 3</li>
                    </ol>
                </li>
                <li>UPPER ALPHA 2</li>
                <li>UPPER ALPHA 3</li>
            </ol>
        </li>
    </ol>';
$docx->embedHTML($html);
$docx->createDocx('output');