Forum


Replies: 1   Views: 1627
Html styling for paragraph within a list
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  · 06-07-2020 - 18:25

Hello,

phpdocx doesn't allow adding p or other block contents to list items (this limitation comes from the OOXML standard, that doesn't allow adding a w:p tag in a w:p tag, DOCX handles list as paragraphs but with an extra style). You need to remove block contents when working with lists, only inline items are allowed:

<ul>
    <li>
        Something<br/>Some content
    </li>
</ul>

Also note that MS Word neither allow adding some content types in lists. You can apply indent values to paragraph and other contents such as tables if needed to get the same indentation.

Regards.