Power Automate: How to Style HTML Tables with CSS
Stop sending ugly emails! Learn to apply custom CSS to the Power Automate Create HTML Table action and use our free generator to style data instantly.

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 An example of a simple CSS block: --- 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: Once you're happy with the design, simply click Copy CSS and paste it directly into your "Compose - CSS" action. --- The final step is to merge your CSS and your Table in the email body. When the email arrives, Outlook (or Gmail/Teams) will read the hidden --- tags. Because Power Automate tables use standard HTML elements (,
, , ), you target those tags directly. <style>
table {
border-collapse: collapse;
width: 100%;
font-family: Arial, sans-serif;
}
th {
background-color: #4f46e5;
color: white;
padding: 12px;
text-align: left;
}
td {
border-bottom: 1px solid #e2e8f0;
padding: 10px;
}
</style>3. The Secret Weapon: The HTML Table Styler
4. Combine and Send
> icon to switch to HTML View (this is critical!).
- 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. block and apply your beautiful styling to the table!Want to do more with SharePoint data? Read our guide on Power Automate + SharePoint: 7 Document Workflows That Save Hours to see how sending styled reports fits into larger enterprise solutions.
FAQs
Does this work in Outlook and Microsoft Teams?
Yes! Both Outlook desktop/web and Microsoft Teams support inline tags appended before HTML tables. The CSS generated by our tool is highly compatible with modern email clients.Why are my table borders not showing?
Ensure that your CSS targets the table, th, and td elements specifically, and double-check that you switched your Email action to HTML View (>) before inserting the dynamic content.Can I conditionally format rows (e.g., turn a row red if "Status" is "Failed")?
The base "Create HTML table" action does not support row-level conditional formatting natively. To achieve this, you must write a custom HTML loop using an "Apply to each" action and Power Automate expressions to inject style="color:red" on specific tags based on conditions.