Forum


Replies: 24   Views: 10876
<li> with strictwordstyles = true
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-12-2015 - 15:33

Hello,

Then you need to set the strictWordStyles option as false for that chunk of text, there's no other approach to do it in the current version of phpdocx when you import a HTML. As list as paragrahs internally, to create a custom style you just need to remove the top and bottom margins in your template.

This is a quick patch to add support when strictWordStyles is true:

Edit the file HTML2WordML.inc and in line 1949 (after the 'if (!$this->strictWordStyles) {') add this:

 else {
  $stringListPr .= $this->pPrSpacing($properties);
}

Now you can set a custom spacing, for example:

$html .= '<ul><li style="margin-bottom: 10px;margin-top: 10px;">one</li><li style="margin-bottom: 0px;margin-top: 0px;">two</li><li style="margin-bottom: 0px;margin-top: 0px;">three</li></ul>';

Setting the 0px to top and bottom you can remove the spacing between items. You may use inline styles or a CSS stylesheet.

Regards.