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.