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 / Correction in HTML Tab...
Power Automate
Unanswered

Correction in HTML Table Column formatting

(0) ShareShare
ReportReport
Posted on by 2

I am using the below code in my style compose code to make first column data of the HTML table and it is working fine, it brings the correct formatting in my email.

 

#table2 td:first-child {
text-align: right;
}

 

But when I try the below to apply for the 3rd column, it has no error and no impact of code, it remains as it is - no changes can be seen for the column:

 

#table2 td:nth-child(3)
{
text-align: right;
}

 

Is there is other way to write to impact the third row data.

 

Please advise

 

Categories:
I have the same question (0)
  • Expiscornovus Profile Picture
    33,189 Most Valuable Professional on at

    Hi @MIA27,

     

    Yes, as far as I am aware the nth:child selector is ignored in Outlook.

     

    Have a look at this article/blog from Ryan Maclean:

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

     

    He demonstrates in the advanced styling part of that blog how you can build your own custom table with advanced styling. By using that approach instead of the create HTML table you should be able to style the 3rd column.

  • MIA27 Profile Picture
    2 on at

    As I am not very good in html coding, the website has many steps which I need learn.

     

    at least padding is not possible for the a particular column.

    No other workaround?.

     

    If possible please guide

     

  • MIA27 Profile Picture
    2 on at

    I found some discussion on the this issue

    https://stackoverflow.com/questions/73612377/alternatives-to-css-n-th-child-selector-in-html-table-for-outlook 

     

     

    But could not understand how to apply the below in my situation

    table.table2 tr td + td + td + td +td {
     text-align: right;
    }

     

    Is it possible, to arrange a workaround.

     

    Please guide

     

  • Verified answer
    Expiscornovus Profile Picture
    33,189 Most Valuable Professional on at

    Hi @MIA27,


    Below is an example for the third column.

     

    In this case I have set the background colour to red.

     

    <style>
    table td + td + td {
     background-color: #ff0000;
    }
    table td + td + td + td {
     background-color: #ffffff;
    }
    </style>
    @{body('Create_HTML_table')}

     

    thirdcolumnbackgroundcoloursetup.png

     

    And the test result in Outlook OWA

     

    examplestyling.png

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