web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / format table cells bac...
Power Apps
Unanswered

format table cells background with HTML

(0) ShareShare
ReportReport
Posted on by

Hi,

im buliding a powerapp that eventually need to send a mail, i used the method suggested in this article in order to produce the formated mail as html and send it.

in my mauil im sending a table with status field i want the status to have diffrent background collor according to the value: good: green, moderate: yellow, bad: red.

i tried diffrnet combinations of the below formula but didnt manage,any ideas what would be the syntax for that?

 

<td width=104 colspan=2 valign=top style='width:78.0pt;border-top:none;border-left:none;border-bottom:solid;background ="""&If(Status="Good","#00B050", If(Status="Moderate"," yellow", If(Status="Bad"," red ")&""">"  windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0in 5.4pt 0in 5.4pt'><p class=MsoNormal>"& Status.Value &"<o:p></o:p></p></td>

 

thanks,

Eyal

Categories:
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Perez 

    Please consider changing your Formula to the following:

    <td width=104 colspan=2 valign=top style='width:78.0pt;border-top:none;border-left:none;border-bottom:solid;background:" & 
    Switch(Status.Value, "Good", "#00B050", "Moderate", "yellow", "Bad", "red") & 
    ";border-right:solid;padding:0in 5.4pt 0in 5.4pt'>
    <p class=MsoNormal>" & Status.Value & "<o:p></o:p></p></td>

     

    I hope this is helpful for you.

     

     

  • EP-29071004-0 Profile Picture
    on at

    @RandyHayes , thanks, it solved my issue, it work now perfectly!!!

    have one more question, for some reson the html code add few empty rows at the bottom of the table, have any idea why? should i open a new issue for this one?

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Perez 

    How are you building your rows?  The Html you sent before only dealt with the specific section with the color.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 345 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 312

#3
Mohsin Ali Profile Picture

Mohsin Ali 252

Last 30 days Overall leaderboard