Forum


Replies: 2   Views: 1263
Updating a list to match style
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 pwctechnicalsecurity  · 01-04-2021 - 20:23

Hi team,

Quick question. I am looping to generate a number of documents (generally adding new content through EmbedHTML; one of the last steps is to check for all lists in my $docx. 

$docx->customizeWordContent(array(
    'type' => 'list'
), array(
        'type' => 18,
        'pStyle' => 'ListBullet',
        'lineSpacing' => 280
    )
);

Bottom line is that all lists in HTML that are declared like the following code, render perfectly to what I need.

{% if solution.sub_solutions | length > 0 %}
<ul>
    {% for sub_solution in solution.sub_solutions %}
    <li>{{ sub_solution }}</li>
    {% endfor %}
</ul>
{% endif %}

However, as soon as it is embedded in a table, it does not work (wordStyle: Normal, expected: ListBullet). Example:

<table>
    <tr>
        <td>{% if solution.sub_solutions | length > 0 %}
            <ul>
                {% for sub_solution in solution.sub_solutions %}
                <li>{{ sub_solution }}</li>
                {% endfor %}
            </ul>
            {% endif %}</td>
    </tr>
</table>

Any ideas?