How to get it correctly

Screenshot 2024-04-01 171338

{% set rows = doc.other_charges_calculation.split(‘\n’) %}

                    {% if rows %}
                    <tbody>
                        {% for i in range(0, rows|length, 4) %}
                            <tr>
                                <td>{{ rows[i] }}</td>
                                <td>{{ rows[i + 1] }}</td>
                                <td>{{ rows[i + 2] }}</td>
                                <td>{{ rows[i + 3] }}</td>
                            </tr>
                        {% endfor %}
                    </tbody>
                    {% endif %}
                </table>

Hi @amal_31845,

Good reference of @Yamen_Zakhour,

Little bit modification of the code:

<table class="table table-bordered table-condensed">
<tbody>
    {% set rows = doc.other_charges_calculation.split('</tr>') %}
    {% for row in rows[:-1] %}
        {% if loop.index > 1 %}
            {% set cells = row.split('</td>') %}
            {% set has_value = false %}
            <tr>
                {% for cell in cells %}
                    {% if cell.strip() %}
                        {% set has_value = true %}
                        <td>{{ cell.split('>')[-1]|striptags|safe }}</td>
                    {% endif %}
                {% endfor %}
            </tr>
        {% endif %}
    {% endfor %}
</tbody>
</table>

Output:

looks like the same format.

try it according to the scenario.

Thank You!