0

Here is my for which I want the text should be displayed in the center of each cell.

Here is my td.

 <td style="{!'background-color: #' + if(profileList.Quantity le 10, '00FF00',
                                      if(profileList.Quantity le 14, 'FFFF00',
                                      if(profileList.Quantity le 19, 'FFA500', 'FF0000')))}">{!profileList.Quantity}</td>

how can I used text-align:center along with this bound expression?

5

You can simply use slds-text-align_center to the td or if you want along with the bound expression you want to append a style .

EG:

 <td class="slds-text-align_center" style="{!'background-color: #' + if(profileList.Quantity le 10, '00FF00',
                                  if(profileList.Quantity le 14, 'FFFF00',
                                  if(profileList.Quantity le 19, 'FFA500', 'FF0000'))) + ';text-align:center;' }">{!profileList.Quantity}</td>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.