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 Automate / Applying CSS style she...
Power Automate
Unanswered

Applying CSS style sheets to specific column of HTML table

(0) ShareShare
ReportReport
Posted on by 2
Hello,

I hope someone can help me with this one; I'm struggling to find a working solution after much searching.

 
I have built a flow that generates multiple HTML table from a PowerBI query, applies a CSS style table to each and emails the compiled tables to selected users. Overall, the CSS style sheets work well for each table, with each separate table having its own style sheet.

However, I cannot for the life of me figure out how to apply formatting to specific columns within each table. The intention is to have a red/green colour coding to instruct users to specific columns, but building this into the CSS style table is proving fruitless.

 
An example of the style sheet I'm using is as below:
 
 
Note the nth-child, with the intention of changing the 6th column to a specific colour.
 
The tables are generated via a PowerBI query, which is then filtered and the table class added to the HTML:
 
 
The generated HTML tables are then appended to the CSS style sheets (max five in total), producing an email:
 

 
However, the final output does not have the expected colouring on the sixth column, although all other formatting is applied:
 
 
I also intend to have two different coloured columns, and I'm not sure if this is a further complication considering I can't get a single column to work!

Any help appreciated and happy to provide any further details!
Categories:
I have the same question (0)
  • David_MA Profile Picture
    14,485 Super User 2026 Season 1 on at
    The only way I have been able to figure out how to do this is through using a string variable to generate the table.
    1. The default value of the string variable would contain the <table> and <th> tags for the header.
    2. You would then add an apply to each on your data to process each row individually to construct the <tr><td></td></tr> and you would use expressions on the data to use inline CSS to do the formatting you want by using the append to string variable action.
    3. After the apply to each, you would append the string variable with the table closing tag </table>
    4. You would use the variable in the body of your e-mail to insert the table.
  • VictorIvanidze Profile Picture
    13,081 on at
    Do not use CSS. Use inline styles.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 976

#2
Valantis Profile Picture

Valantis 863

#3
Haque Profile Picture

Haque 547

Last 30 days Overall leaderboard