Power Automate: How to Style HTML Tables with CSS
Style Power Automate HTML tables with custom CSS for professional-looking emails. Free generator included to create polished email tables without writing code.

Stop Sending Ugly Emails
By default, the Power Automate "Create HTML table" action generates a functional but incredibly ugly table. If you're sending automated daily reports, approval requests, or SharePoint list summaries to executives, an unstyled, borderless table looks unprofessional.
Fortunately, you can inject custom CSS directly into your flow before sending the email.
This guide will show you the exact architecture needed to style your tables, and introduce a free tool to generate the CSS instantly without writing code.
---
1. The Power Automate Architecture
To style an HTML table in Power Automate, you need three actions in this specific order:
- Create HTML table: This action takes your array of data (e.g., from "Get items" in SharePoint) and converts it to raw HTML.
- Compose (for CSS): This is where you store your
tags containing your CSS rules.
- Send an email (V2): Here, you combine the CSS and the table output.
Formatting Your Data First
Before creating your table, ensure your data is clean. You don't want raw timestamps or null values polluting your report. Use a Select action to map your SharePoint columns to clean headers, and use Power Automate Expressions like
formatDateTime() or coalesce() to clean up the data.
---
2. Writing the CSS (The Compose Action)
Once your table is created, add a Compose action. Rename it to "Compose - CSS".
In the inputs, you need to write standard CSS wrapped in
tags. Because Power Automate tables use standard HTML elements (, , , ), you target those tags directly.
Basic Professional Table Styling
An example of a simple CSS block:
``html
`
Responsive & Email-Safe CSS Patterns
Email clients (especially Outlook) have limited CSS support. Here's a responsive pattern that works reliably across all email clients:
`html
`
Conditional Row Coloring by Status
To highlight specific rows based on their content (e.g., red for "Failed", green for "Approved"), you need to use Power Automate expressions to inject inline styles:
`html
`
Then in your "Apply to each" loop that generates the table rows, conditionally assign the class:
`
`
---
3. The Secret Weapon: The HTML Table Styler
Manually tweaking hex codes, padding sizes, and border widths inside a tiny Power Automate Compose box is frustrating. You can't see what the table looks like until you run the flow and check your email.
Instead of guessing, use our free Power Automate HTML Table Styler.
This visual tool allows you to:
- Pick premium color themes (Corporate Blue, Midnight Dark, Emerald, etc.)
- Adjust padding and font sizes instantly
- Toggle borders and striped rows
- See a live preview of exactly how your table will look in Outlook
Once you're happy with the design, simply click Copy CSS and paste it directly into your "Compose - CSS" action.
---
4. Combine and Send
The final step is to merge your CSS and your Table in the email body.
- Add a Send an email (V2) action.
- Click the
> icon to switch to HTML View (this is critical!).
- In the body, place your dynamic content in this exact order:
- First: The Outputs from your "Compose - CSS" action.
- Second: Any introductory text (e.g., "Here is the daily report:").
- Third: The Output from your "Create HTML table" action.
When the email arrives, Outlook (or Gmail/Teams) will read the hidden