Forum


Replies: 2   Views: 198
Line spacing when inserting a list of html using a template
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  · 17-06-2019 - 07:27

Hello,

Setting a custom list style and CSS line-height style, spacing value is set. For example, running the following script:

$latinListOptions = array();
$latinListOptions[0]['type'] = 'lowerLetter';
$latinListOptions[0]['format'] = '%1.';
$docx->createListStyle('latin', $latinListOptions);

$html = '
<style>
    li {
        line-height: 2em;
    }
</style>
<ul class="latin">
    <li>Item A</li>
    <li>Item B</li>
    <li>Item C</li>
</ul>';
$docx->embedHTML($html, array('customListStyles' => true));

All list items have Line spacing as Multiple and 1,67 as value.

Regards.