Forum


Replies: 2   Views: 94
How to create a bullet list with a dash '-' symbol?

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.