Text wrapping / converting markdown table to HTML

Hi,

I’m having an issue with markdown tables, where the input text doesn’t automatically wrap and create line breaks unless the schedule is previewed or locked.

I believe this can be fixed with an HTML table, but please suggest if there is a better way to achieve the wrapping. I’m struggling to get the HTML to work as when I add ‘input’ sections I receive errors. How should I structure the coding for the inputs?

This is the original markdown table coding:

|TSG Review Point
|AAG/BSG Comment
|Review Point Cleared (TSG Initial and Date)
{% newline %}
|----33%----
|----33%----
|----34%----#
{% newline %}
{% fori item in custom.related_parties %}
 |{% input item.related_party placeholder:'Review point' %}
 |{%=$1+input item.nature placeholder:'Response' %}
 |{%=$2+input item.transaction placeholder:'Sign off' %}
 {% newline %}
{% endfori %}
{% endstripnewlines %}

Here is the table, demonstrating the issue:

Let me know your thoughts!

Thank you

1 Like

Hi @Mike.davis

We don’t provide any dedicated classes in HTML tables to manipulate wrapping behaviour inside a table. So the text wrapping should behave the same in Markdown as it does in HTML in input/preview/PDF.

But if I understand correctly, you want the lines to wrap while also inside input view, instead of only in export?

I believe the only way to achieve text wrapping inside an input instead of it always being one long line, is to print these inputs as textareas instead of standard text inputs:

{% stripnewlines %}
|TSG Review Point
|AAG/BSG Comment
|Review Point Cleared (TSG Initial and Date)
{% newline %}
|----33%----
|----33%----
|----34%----#
{% newline %}

{% fori item in custom.related_parties %}
 |{% input item.related_party as:text placeholder:'Review point' %}
 |{%=$1+input item.nature as:text placeholder:'Response' %}
 |{%=$2+input item.transaction as:text placeholder:'Sign off' %}
 {% newline %}
{% endfori %}

{% endstripnewlines %}

I hope this helps you further, but let me know if I misunderstood something or I can assist you with anything else!

Kind regards
Wouter

Hi @Wouter_Bruynsteen,

Thank you very much for your response, that makes sense.

I’ve added in the ‘as:text’ part as you described and that has worked really well, thank you.

Just as a reference for anyone else encountering this issue, I figured out a good workaround to suit our needs for the wrapping functionality - by forcing the row height to be slightly larger, adding in an additional column to the table for attachments and adding white text either side as below:

The coding being:

|TSG Review Point
|AAG/BSG Comment
|Review Point Cleared (TSG Initial and Date)
|Attachment
{% newline %}
|----40%----
|----35%----
|----20%----
|----5%----#
{% newline %}
{% fori item in custom.related_parties %}
 |{% input item.related_party as:text placeholder:'Review point' %}
 |{%=$1+input item.nature as:text placeholder:'Response' %}
 |{%=$2+input item.transaction as:text placeholder:'Sign off' %}
 |<font color="FFFFFF" size="1">_______________</font>{% input custom.file.[p] as:file_collection placeholder:" "  %} <font color="FFFFFF" size="2">___________</font>
 {% newline %}
{% endfori %}
{% endstripnewlines %}

Many thanks for your help Wouter.

Kind regards,

Mike