Skip to main content
Community site session details

Community site session details

Session Id : oMnJ1oeLzWd7l8jN9MRbnk
Power Automate - Building Flows
Answered

How to change last row formatting in table with CSS for email

Like (0) ShareShare
ReportReport
Posted on 17 Mar 2022 23:39:14 by Microsoft Employee

My flow is grabbing rows from an SPO List.

It is also calculating totals of those rows.

 

lardo5150_0-1647560076475.png

 

 

lardo5150_1-1647560114692.pnglardo5150_2-1647560133374.png

 

lardo5150_3-1647560149581.png

 

lardo5150_4-1647560170961.png

 

lardo5150_5-1647560192256.png

 

lardo5150_6-1647560208332.png

 

 

<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;
}
table tr:last-child {
 font-weight: bold;
}
</style>

 

 

I have tried every combination possible to make the last row of the table different.

Background color, bold, etc.  It never changes.  It stays the same as the rest.

i also tried to do alternating rows different colors, but that also did not work.

The above formula does produce a colored header, but other than that i can't get any other formatting to work.

 

lardo5150_7-1647560305619.png

 

Can anyone help me with two things.

1.  Alternating row colors

2. last row either just bold or bold and a completely different color.

  • Verified answer
    lardo5150 Profile Picture
    Microsoft Employee on 18 Mar 2022 at 18:44:56
    Re: How to change last row formatting in table with CSS for email

    So this looks to be a bug.

    I saw one or two other posts like this, and there was no answer either.

    Reading through his blog:

    https://ryanmaclean365.com/2020/01/29/power-automate-html-table-styling/

    He mentions he had the exact same issue, so he has a second way of doing it.

    I ended up just redoing my flow like he did on the second part, and it is now working.

  • lardo5150 Profile Picture
    Microsoft Employee on 18 Mar 2022 at 16:28:48
    Re: How to change last row formatting in table with CSS for email

    Does it have anything to do with how your compose is working vs mine?

    i am doing the CSS Style along with Output.

    In yours, you are doing the CSS STyle but manually entering the table information.

  • lardo5150 Profile Picture
    Microsoft Employee on 18 Mar 2022 at 14:59:13
    Re: How to change last row formatting in table with CSS for email

    so I even went back and did a new compose straight on the output from create an html table.

    It seems no matter what I do, i am able to format the table, format the headers, but nothing else.

    I can format the entire body, but I am not able to do anything with the individual rows.

    I can't figure out what I am doing different than you, especially since our outputs are the same.

  • lardo5150 Profile Picture
    Microsoft Employee on 18 Mar 2022 at 14:49:35
    Re: How to change last row formatting in table with CSS for email

    Crazy, not sure where to even look on this.

    Did it exactly like that, just using the last row piece and nothing else.

    It never came across as colored.

  • ArchitectMadhan Profile Picture
    1,580 on 18 Mar 2022 at 14:28:39
    Re: How to change last row formatting in table with CSS for email

    Hi @lardo5150 ,

    Here is the Compose with your table content and style for last row.

    ArchitectMadhan_0-1647613549557.png

    Send Email action:

    ArchitectMadhan_1-1647613611596.png

    Final output in Received email (from Outlook):

    ArchitectMadhan_2-1647613670244.png

     

  • lardo5150 Profile Picture
    Microsoft Employee on 18 Mar 2022 at 13:37:31
    Re: How to change last row formatting in table with CSS for email

    From what I can tell, it looks the same.

    is it the email portion of it maybe?  something the email does not like or is your output from the email?

  • lardo5150 Profile Picture
    Microsoft Employee on 18 Mar 2022 at 13:27:52
    Re: How to change last row formatting in table with CSS for email

    @ArchitectMadhan sorry, I have the same, when I removed my data, i did it wrong.

    Here is what I actually have:

     

    <table><thead><tr><th>Engineer</th><th>Total Assigned</th><th>Crits Assigned</th><th>Non-Crits Assigned</th><th>POCs Assigned</th><th>B 24x7 Assigned</th><th>B Assigned</th><th>C Assigned</th><th>SEV 1 Assigned</th><th>SIE Assigned</th></tr></thead><tbody><tr><td>John Doe</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr>
    <td>TOTAL</td>
    <td>7</td>
    <td>4</td>
    <td>2</td>
    <td>0</td>
    <td>0</td>
    <td>1</td>
    <td>0</td>
    <td>0</td>
    <td>0</td></tr>
    </tbody>
    </table>
  • ArchitectMadhan Profile Picture
    1,580 on 18 Mar 2022 at 13:13:06
    Re: How to change last row formatting in table with CSS for email

    Hi @lardo5150 ,

    The output of you table is shown below, basically table is not formed properly, as you see there are 10 td (Columns) in the last row, whereas your first row, next to the header has only one td (column). Please use the table which I sent as a reference.

    Output of your table:

    ArchitectMadhan_1-1647609158180.png

     

     

  • lardo5150 Profile Picture
    Microsoft Employee on 18 Mar 2022 at 13:03:13
    Re: How to change last row formatting in table with CSS for email

    I even tried to change the last piece from:

     

    table> tbody> tr:last-child {
    background:#33EEEB;
    }

     

    to:

     

    table tbody tr:last-child {
    background:#33EEEB;
    }

     

    Same result, no color on the last row.

  • lardo5150 Profile Picture
    Microsoft Employee on 18 Mar 2022 at 12:58:41
    Re: How to change last row formatting in table with CSS for email

    I was able to figure out the split part.  But the last row is still not filling in.

    Here is what I have:

     

    on the compose where I combine the table with the CSS Style, right before we send the email, here is the output with some data removed:

     

    <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;
    }
    table> tbody> tr:last-child {
    background:#33EEEB;
    }
    </style>
    <table><thead><tr><th>Engineer</th><th>Total Assigned</th><th>Crits Assigned</th><th>Non-Crits Assigned</th><th>POCs Assigned</th><th>B 24x7 Assigned</th><th>B Assigned</th><th>C Assigned</th><th>SEV 1 Assigned</th><th>SIE Assigned</th></tr></thead><tbody><tr><td></td></tr><tr>
    <td>TOTAL</td>
    <td>4</td>
    <td>1</td>
    <td>2</td>
    <td>0</td>
    <td>0</td>
    <td>1</td>
    <td>0</td>
    <td>0</td>
    <td>0</td></tr>
    </tbody>
    </table>

     

     

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

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 2

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 2

Loading complete