Right-align text from loop and merge fields | XM Community
Skip to main content
Question

Right-align text from loop and merge fields

  • April 1, 2025
  • 1 reply
  • 12 views

Forum|alt.badge.img+1

I have a multiple choice question in which I’m using two loop and merge fields in the question text. Sometimes, the text in the loop and merge fields is LTR, sometimes it is RTL. Like this:

 

To make sure the RTL messages are displayed correctly, I added dir=”rtl” and align=”right” to the RTL texts.

However, while the dir attribute seems to work, I cannot get the text in row 1, field 2 to right-align with the align attribute. For example, this is what the first question looks like:

As far as I know, the second line should be right-aligned because of the align attribute I added to the text in the loop and merge field.

This is the HTML of the question text:


${lm://Field/1}
<br>
<br>
${lm://Field/2}
<br>
<br>
Score how similar they are to each other according to the following scale:


 

What am I doing wrong here?

1 reply

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • 5937 replies
  • April 1, 2025

You need to do two things:

  1. Specify the direction correctly
  2. Put the text in a block element (div)
<div style="direction:rtl;">Right to left text</div>

 


Leave a Reply