Style daily Power Automate email in a HTML Table

To add on to one of my previous posts, here is how you style your daily email in a nice HTML table.

1. set up the trigger are "Recurrence"

 

2. Add a "Current Time" step.

 

3. Convert the time zone

 

4. Turn time zone into a variable

 

5. Format that variable into a formula using compose

formatDateTime(variables('TodaysDate'),'MM-dd-yyyy')

 

6. This particular flow is using dataverse as it's datasource. (For SharePoint List you would use "Get Items" in this step, Click here to see what that looks like) I am using the step "List Rows" (Outputs is from the compose step before)

Field names come from the table listed in table names. 

7. Next step Create a HTML table using the dataverse step.

8. Add styling if you like using "Compose"

The CSS code for the styling if you'd like to tweak and use.

<style>
table {
  border: 1px solid #1C6EA4;
  background-color: #EEEEEE;
  width: 100%;
  text-align: left;
  border-collapse: collapse;
}
table td, table th {
  border: 1px solid #AAAAAA;
  padding: 3px 2px;
}
table tbody td {
  font-size: 13px;
}
table thead {
  background: #1C6EA4;
  border-bottom: 2px solid #444444;
}
table thead th {
  font-size: 15px;
  font-weight: bold;
  color: #FFFFFF;
  border-left: 2px solid #D0E4F5;
}
table thead th:first-child {
  border-left: none;
}
</style>

9. Send the email step

First output is the compose step with the CSS in it and the second Output is the "Create HTML table" step

The results: