Forum


Replies: 12   Views: 3704
Custom list style issues
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 tutotours  · 11-09-2017 - 21:29

Hello !

I have some problems with custom list styles.

 

First, this code doesn't seem to work to make list left indent to 0 :

$itemsOptions[0]['type'] = 'upperLetter';
$itemOptions[0]['left']= 0;

// create the list style with name: latin
$docx->createListStyle('items', $itemsOptions);
$docx->replaceVariableByHTML('BODYCOLLE', 'block', $html, array(
            'downloadImages' => true,
            'parseDivsAsPs' => true,
            'customListStyles' => true
));

UpperLetter option is working fine but left option doesn't.

 

I also have some list items which have line breaks before them with no reason. I checked HTML and the line break is not there in it but appears in the Docx.

Ex : 

Should be : 

A. Item 1

Appears as :

A.

Item 1

 

I saw that it's happening when I have images or a line with bold writing on the line before.

I can send you an example if you don't know what I mean.