Forum


Replies: 1   Views: 149
Html styling for paragraph within a list

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.