function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
John DaJohn Da 

Line Break and Indent for Alignment In Apex Repeat

Hi all,

I am using Apex Repeat to get all the children objects of a parent object and print out their fields values. Apex OutputText does not respect new line characters for a Text Area field, so I had to write a split function in the controller to cut the text by line break characters.

The issue is that it goes down a new line but does not align with the previous text in the same field. So it will be like this:

1. Goals for this year: * Complete all training
* Sell more goods
* Get customer's feedback

("Sell more goods" and "get customer's feedback" should be indented to right below "Complete all training").

This is Apex Repeat's getting data and "complete all training .... feedback" is 1 field data, so I don't know how to put indentation in this scenario. Any suggesstions or help will be appreciated.
Best Answer chosen by John Da
RishavRishav
HIii, 
 Put the all result component inside <table> and use <tr> <td> .. then see what happens .
If u have already done this then please post the code so that we will get an idea what need to do .

Thanks
Rishav

All Answers

RishavRishav
HIii, 
 Put the all result component inside <table> and use <tr> <td> .. then see what happens .
If u have already done this then please post the code so that we will get an idea what need to do .

Thanks
Rishav
This was selected as the best answer
John DaJohn Da
Table works perfectly. Thank you Rishav.