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?

1 Answer 1

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>

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .