Forum


Replies: 2   Views: 822
How to create a bullet list with a dash '-' symbol?
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 skwirrel  · 24-05-2022 - 08:26

Is it possible to create a list with a dash '-' symbol?

Posted by admin  · 24-05-2022 - 09:23

Hello,

Yes, setting the format option in createListStyle you can set a custom symbol. For example:

$docx->createListStyle('mystyle', [
    0 => [
        'type'     => 'bullet',
        'format'   => '-',
    ],
]);

// list items
$myList = array('item 1', 'item 2', 'item 3');

// insert the custom list into the Word document
$docx->addList($myList, 'mystyle');

Regards.

Posted by skwirrel  · 25-05-2022 - 13:09

Perfect, thanks.