How i can Shrink HSN Column To fit only for 4 digits ,
as when i convert the invoice into pdf , hsn column takes too much space and hence results into shrinking of description column .
after converting into pdf and opening into chrome
https://forum.manager.io/uploads/short-url/tRS4oXnHdsrQy7VaY3PbS2BrHZA.png
i think wrap and nowrap can do something but that doesn’t work for me .
i want fixed width . as HSN will always be of 4 digits for me .
thanks for the help ,
find the below code in your theme.
<tr>
{% for column in table.columns %}
<td style="font-weight: bold; padding: 5px 10px; text-align: {{ column.align }}; border-left-width: 1px; border-bottom-width: 1px; border-top-width: 1px{% if forloop.last == true %}; border-right-width: 1px{% endif %}{% if column.nowrap %}; white-space: nowrap; width: 80px{% endif %}">{{ column.label }}</td>
{% endfor %}
</tr>
replace the above with the following code.
<tr>
{% for column in table.columns %}
{% if column.label != 'HSN' %}
<td style="font-weight: bold; padding: 5px 10px; text-align: {{ column.align }}; border-left-width: 1px; border-bottom-width: 1px; border-top-width: 1px{% if forloop.last == true %}; border-right-width: 1px{% endif %}{% if column.nowrap %}; white-space: nowrap; width: 80px{% endif %}">{{ column.label }}</td>
{% else %}
<td style="font-weight: bold; padding: 5px 10px; text-align: {{ column.align }}; border-left-width: 1px; border-bottom-width: 1px; border-top-width: 1px{% if forloop.last == true %}; border-right-width: 1px; white-space: wrap; width: 80px">{{ column.label }}</td>
{% endif %}
{% endfor %}</tr>
Adjust the width after the {% else %} tag according to your size requirements.
3 Likes
Thanks my friend @sharpdrivetek
this isn’t working. it shows parsing error.
Tut
December 17, 2018, 2:16pm
5
This is an example of why this forum is not meant for solving coding problems. If you don’t have the skills, hire a local programmer.
1 Like