Text Alignment to left
Application Type
Traditional Web

Hi All, 

 I want below text 

Relationship Manager Details

         Person: Natasha Bell
Email: abc@mail.com
Fixed Phone:
              Mobile Phone:

in below fromat

Relationship Manager Details

Person: Natasha Bell
Email: abc@mail.com
Fixed Phone:
Mobile Phone:

,  Its all coming in text format in single cell, how to format it, can any one help on it.

Thanks 

Balaji

Hi Balaji,

You can parse the data from response & change the format or you can use js to remove the spaces.

If you are planning to use js, add a class called 'remove-spaces' to table cell & make use of following snippet

"
<script>
var txt = document.getElementsByClassName('remove-spaces');
    for(var i=0; i<txt.length; i++) {
        txt[i].innerHTML = txt[i].innerHTML.replaceAll(' ', '')
    }
</script>
"


Thanks,

Paramasivam

Hi @Balaji Ravikumar ,

You can simply use replace function

Replace(GroupText,"  ",NullTextIdentifier())

Output:


Hope this will help

Thanks, Aadhavan S

mvp_badge
MVP

Hi Balaji,

It's not quite clear what your problem is. Can you share some screen shots of the output, and perhaps also share your module?

Hi @Kilian Hekhuis 

        I am receiving below text from API to display in Table column.

Relationship Manager Details

         Person: Natasha Bell
Email: abc@mail.com
Fixed Phone:
              Mobile Phone:
dd

      But I want to align as below in the table column.

Relationship Manager Details

Person: Natasha Bell
Email: abc@mail.com
Fixed Phone:
Mobile Phone:

       I tried by using left alignment form property but its not giving expected result.

Thanks 

Balaji 

Hi Balaji, 

Can you try clicking on the cell then clicking on the left align button on the toolbar

Hope this fix the issue. If not, it's possible that there's a css being applied on the cell that needs to be modified and It would be great to provide an oml for inspection

Cheers

Hi @Marco Mateo 

       Its not helping to resolve it, can you give any other solution to fix it.

Thanks in advance

Hi Balaji, 

I hope this will help you, try using the alignment property of that cell. make it aligned to left. 

If you have already tried it, then could you please provide your oml file for reference?

Thank You,

Mita


Please have a look on above details column, its not aligned as expected.

Thanks

Balaji

Hi Balaji,

Please find the below oml file for your reference and let me know if it is helping you.

Thank You,

Mita

TestForalignment.oml

Hi Balaji,

If the cell align attribute solution suggested by @Marco Mateo is not working for you, then I guess you are enclosing each line of the cell in a container. Set alignment for each container using container's style editor.

Hope this helps, if not Please share the oml for further inspection.


Hi @Balaji Ravikumar,

It seems text value coming with space. You need to align in source

mvp_badge
MVP

Indeed. If the API outputs text instead of structured content, parse the data and then output it formatted the way that's desired.

Hi @Balaji Ravikumar ,

You can simply use replace function

Replace(GroupText,"  ",NullTextIdentifier())

Output:


Hope this will help

Thanks, Aadhavan S

mvp_badge
MVP

Please do not use NullTextIdentifier() if you want an empty string! Just use "" instead! NullTextIdentifier() is meant to be used for NULL values of a foreign key that has a Text as Identifier. It's the same as TextToIdentifier(""). Don't use it for things like the above!

Hi All, 

  We dont have option to change it on source, so is there any other way to align on expression by using any style properties. 

Thanks and Regards

Balaji  

Hi Balaji,

You can parse the data from response & change the format or you can use js to remove the spaces.

If you are planning to use js, add a class called 'remove-spaces' to table cell & make use of following snippet

"
<script>
var txt = document.getElementsByClassName('remove-spaces');
    for(var i=0; i<txt.length; i++) {
        txt[i].innerHTML = txt[i].innerHTML.replaceAll(' ', '')
    }
</script>
"


Thanks,

Paramasivam

mvp_badge
MVP

There is no need to use JavaScript for things like this! OutSystems is a low-code platform, don't start using high-code if it's not necessary!

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.