Power Automate
How to style HTML table in Power Automate

How to style HTML table in Power Automate

In Power Automate, we use Create HTML Table action to create a dynamic table but this action lacks formatting/styling options.

In this post we’re going to see formatting the table created by power automate using CSS. Here is the sample example of Create HTML table’s output and it does not have any table styling.

Output of Create HTML Table

Power Automate generates HTML code that can be easily modified or styled with help of CSS. Add a compose action as next step to Create HTML table action and enter below CSS to the compose action.

<style>
table {
  border: 1px solid black;
  width: 100%;
  text-align: left;
  border-collapse: collapse;
}

table th {
  border: 1px solid black;
  background-color: #0066cc;
  color:white;
  border-collapse: collapse;
  padding: 5px;
}
table td {
  border: 1px solid black;
  background-color: #EEEEEE;
  border-collapse: collapse;
  padding: 5px;
}
</style>

Add outputs of the compose and Create HTML table actions to Send Email

Here is the formatted table and we can customize our html table / html code as per easy to complex requirements.

Formatted HTML Table

Please post your queries in the comments section. Happy Building 🙂

0

Leave a Reply

Newsletter Signup

Subscribe to our weekly newsletter below and never miss out the latest updates

%d bloggers like this: