Hello,
You need to add a class to the ul tag with the numbering ID value. This sample is working fine:
$listOptions = array();
$listOptions[0]['type'] = 'bullet';
$listOptions[0]['format'] = 'G';
$listOptions[0]['color'] = '0a46ba';
$listOptions[0]['font'] = 'Wingdings';
$listOptions[1]['type'] = 'bullet';
$listOptions[1]['color'] = '0a46ba';
$listOptions[1]['format'] = 'F';
$listOptions[1]['font'] = 'Wingdings';
$docx->createListStyle('bullet', $listOptions);
$html = 'a lot of html and a list <ul class="bullet"><li>example</li></ul> and a bit more html';
$docx->embedHTML($html, array('customListStyles' => true));
Which version and license of phpdocx are you using? And what program are you using to open the DOCX? We have tested it using MS Word and LibreOffice 5 and it opens perfectly (you need to install Wingdings font as you are using it).
Regards.
You where very quick with your reply, i've editted my question to add the class to the list but no changes are visible. Using phpdocx 6.5, could that be the problem?
Hello,
Which license of phpdocx are you using (Trial, Basic, Advanced or Premium)? And what program are you using to open the DOCX? Using the previous code, we have tested it with MS Word and LibreOffice 5, and it shows the numbering style perfectly (you need to install Wingdings font as you are using it).
Regards.
I figured it out, it does work when i use it toplevel but i'm using it in a addtable in a wordfragment
Hello,
It works too using WordFragments, but you need to add the numbering style to the WordFragment:
$htmlWordFragment = new WordFragment($docx);
$listOptions = array();
$listOptions[0]['type'] = 'bullet';
$listOptions[0]['format'] = 'G';
$listOptions[0]['color'] = '0a46ba';
$listOptions[0]['font'] = 'Wingdings';
$listOptions[1]['type'] = 'bullet';
$listOptions[1]['color'] = '0a46ba';
$listOptions[1]['format'] = 'F';
$listOptions[1]['font'] = 'Wingdings';
$htmlWordFragment->createListStyle('bullet', $listOptions);
$html = 'a lot of html and a list <ul class="bullet"><li>example</li></ul> and a bit more html';
$htmlWordFragment->embedHTML($html, array('customListStyles' => true));
$valuesTable = array(
array(
'Title A',
'Title B',
'Title C'
),
array(
'Line A',
'Line B',
$htmlWordFragment,
)
);
$paramsTable = array(
'tableStyle' => 'LightListAccent1PHPDOCX',
'tableAlign' => 'center',
'columnWidths' => array(1000, 2500, 3000),
);
$docx->addTable($valuesTable, $paramsTable);
Regards.