Skip to main content

Notifications

Community site session details

Community site session details

Session Id : xBdcuzCeBF6Nsa27/TJsL8
Power Automate - Building Flows
Answered

Formatting the HTML table is not successful with compose

Like (0) ShareShare
ReportReport
Posted on 17 Apr 2024 06:15:21 by

The following is the flow I'm building. Yue_Jiang_0-1713334272658.png

But the question is that though I've copied the CSS style online about how to format the HTML table, the results don't show when I send out my emails containing the HTML table. The code I copied online is below: 

<style>
table.blueTable {
border: 1px solid #1C6EA4;
background-color: #EEEEEE;
width: 100%;
text-align: left;
border-collapse: collapse;
}
table.blueTable td, table.blueTable th {
border: 1px solid #AAAAAA;
padding: 3px 2px;
}
table.blueTable tbody td {
font-size: 13px;
}
table.blueTable tr:nth-child(even) {
background: #D0E4F5;
}
table.blueTable thead {
background: #1C6EA4;
background: -moz-linear-gradient(top, #5592bb 0%, #327cad 66%, #1C6EA4 100%);
background: -webkit-linear-gradient(top, #5592bb 0%, #327cad 66%, #1C6EA4 100%);
background: linear-gradient(to bottom, #5592bb 0%, #327cad 66%, #1C6EA4 100%);
border-bottom: 2px solid #444444;
}
table.blueTable thead th {
font-size: 15px;
font-weight: bold;
color: #FFFFFF;
border-left: 2px solid #D0E4F5;
}
table.blueTable thead th:first-child {
border-left: none;
}

table.blueTable tfoot {
font-size: 14px;
font-weight: bold;
color: #FFFFFF;
background: #D0E4F5;
background: -moz-linear-gradient(top, #dcebf7 0%, #d4e6f6 66%, #D0E4F5 100%);
background: -webkit-linear-gradient(top, #dcebf7 0%, #d4e6f6 66%, #D0E4F5 100%);
background: linear-gradient(to bottom, #dcebf7 0%, #d4e6f6 66%, #D0E4F5 100%);
border-top: 2px solid #444444;
}
table.blueTable tfoot td {
font-size: 14px;
}
table.blueTable tfoot .links {
text-align: right;
}
table.blueTable tfoot .links a{
display: inline-block;
background: #1C6EA4;
color: #FFFFFF;
padding: 2px 8px;
border-radius: 5px;
}
</style>

 

After I incorporate this into the compose, i include both the Compose's result and the Create HTML table's result into Send emails, which worked well in the past. Hence, I wonder whether this method was right or not. How to improve?

 

  • Verified answer
    v-yetonggu-msft Profile Picture
    on 17 Apr 2024 at 06:26:18
    Re: Formatting the HTML table is not successful with compose

    Hi @Yue_Jiang ,

    Could you please try the html code I provided?

    <style>
    Table {
     font-family: Arial, Helvetica, sans-serif;
     background-color: #EEEEEE;
     border-collapse: collapse;
     width: 100%;
    }
    
    Table td, Table th {
     border: 1px solid #ddd;
     padding: 3px 3px;
    }
    
    Table th {
     font-size: 15px;
     font-weight: bold;
     padding-top: 12px;
     padding-bottom: 12px;
     text-align: left;
     background-color: #1C6EA4;
     color: white;
    }
    </style>

    Remember that in the body of the email, the CSS style format comes first, and the HTML table comes last.

     

    Best Regards,

    Sunshine Gu

  • CU-20080800-0 Profile Picture
    on 17 Apr 2024 at 06:22:04
    Re: Formatting the HTML table is not successful with compose

    I want to add that the result didn't show means that the formatting of HTML table was not successful. Similar to the picture below 

    Screenshot 2024-04-17 141940.png

     

  • v-yetonggu-msft Profile Picture
    on 17 Apr 2024 at 06:20:20
    Re: Formatting the HTML table is not successful with compose

    Hi @Yue_Jiang ,

    Note that the CSS Style format comes first, and the html table comes last.

    Like this:

    vyetonggumsft_0-1713334760585.png

    Best Regards,

    Sunshine Gu

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Automate - Building Flows

#1
David_MA Profile Picture

David_MA 135 Super User 2025 Season 1

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 132 Super User 2025 Season 1

#3
stampcoin Profile Picture

stampcoin 125

Overall leaderboard
Loading started