web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Formatting a specific ...
Power Automate
Unanswered

Formatting a specific table with CSS

(0) ShareShare
ReportReport
Posted on by 13

Hi everyone,

 

I'm having a bit of difficulty where I'm creating a HTML table in PA and utilising CSS to give it some styling, however the footer of the email also has a table which I do NOT want styled with the CSS.

 

I've tried using a replace compose operation similar to as follows with no luck, this is placed directly after the "Create HTML Table element of the flow.

 

replace(body('@{body('Create HTML Table')}'),'<table>','<table class=\"newtableID\">')

 

Any ideas?

Categories:
I have the same question (0)
  • SudeepGhatakNZ Profile Picture
    14,394 Most Valuable Professional on at

    Please upload a screenshot of your flow

     

     

  • neilc28 Profile Picture
    13 on at

    Hi Sudeep,

     

    Thank you for offering your assistance with this! Screenshots as per below: -

     

    Flow OverviewFlow OverviewGet-Items from Sharepoint List and Create HTML Table actionGet-Items from Sharepoint List and Create HTML Table actionCSS Styling with Table Output AppendedCSS Styling with Table Output AppendedHTML Email Content #1HTML Email Content #1HTML Email Content #2HTML Email Content #2

  • neilc28 Profile Picture
    13 on at

     

     

     

    The email output now shows a table cell on the right side,The email output now shows a table cell on the right side,And also puts a table border around the signature areaAnd also puts a table border around the signature area

  • Verified answer
    neilc28 Profile Picture
    13 on at

    I've now resolved this by making the following changes to the flow: -

     

    Compose - Data Operation (Positioned directly below the action to create the HTML Table

     

     

    replace(body('HTML_Table_for_AC_Systems'),'<table>','<table class=CustomTable>')

     

     

    Then adjusted the Compose operation which held the CSS to reference the ID of the table (CustomTable) as per below.

     

     

    <style>
    .CustomTable {
     font-family: Arial, Helvetica, sans-serif;
     border: 1px solid #1C6EA4;
     background-color: #EEEEEE;
     width: 100%;
     text-align: left;
     border-collapse: collapse;
    }
    .CustomTable td, table.CustomTable th {
     border: 1px solid #AAAAAA;
     padding: 3px 2px;
    }
    .CustomTable tbody td {
     font-size: 13px;
    }
    .CustomTable tr:nth-child(even) {
     background: #D0E4F5;
    }
    .CustomTable 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;
    }
    .CustomTable thead th {
     font-size: 15px;
     font-weight: bold;
     color: #FFFFFF;
     border-left: 2px solid #D0E4F5;
    }
    .CustomTable thead th:first-child {
     border-left: none;
    }
    
    .CustomTable 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;
    }
    .CustomTable tfoot td {
     font-size: 14px;
    }
    .CustomTable tfoot .links {
     text-align: right;
    }
    .CustomTable tfoot .links a{
     display: inline-block;
     background: #1C6EA4;
     color: #FFFFFF;
     padding: 2px 8px;
     border-radius: 5px;
    }
    </style>

     

     

    Hope this helps anyone who has experienced the same issue

  • SudeepGhatakNZ Profile Picture
    14,394 Most Valuable Professional on at

    Sorry, I got busy. Great that you sorted it yourself.

     

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard