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 / Format the email under...
Power Automate
Unanswered

Format the email under Create HTML Table

(0) ShareShare
ReportReport
Posted on by 176

Hi Guys,

I have used the Create HTML table action and send email action in my flow but the columns and data under columns are not properly aligned in the emails. 

How can I display the output in proper way? 

RajSingh_0-1705923646369.pngRajSingh_1-1705923709642.png

Thanks

Categories:
I have the same question (0)
  • Verified answer
    eliotcole Profile Picture
    4,363 Moderator on at

    Hiya, @RajSingh, nice to see you back again!

     

    Could you please perhaps update the question with an image of what it does look like when it sends?

     

    It would be very odd for any component to adjust the spacing of a table.

     

    Off the bat, I have a couple of pieces of advice that might help you, though.

     

    Enter Code

    First piece of advice is to add the table in the 'code' view of the email action.

     

    So, within the 'Send an email (v2)' action:

    1. Tap the '</>' button
    2. Delete *everything* currently there
    3. Pick the table output

     

    Now you can test it to see if it looks OK! 👍

     

    Adjust The CSS

    This would require you doing the former, first.

     

    If you are aware of CSS (Cascading Style Sheets), you can use a fair amount of CSS styles (do a StartPage search for what is allowed in Outlook) to adjust the <TABLE>, <TH>, <TR>, <TD>, and more, entity tags in the HTML before the output of the table.

     

    You would simply have something in there like the following to make all tables 100% width of the parent tag that they are inside:

    <STYLE>
     table {
     width: 100%;
     }
    </STYLE>
    @{outputs('Create_HTML_table')}

     

  • royg Profile Picture
    on at

    Try adding a <style> tag and use CSS to style your table/header/rows to your body (or using compose outputs)

  • eliotcole Profile Picture
    4,363 Moderator on at

    Yeah, that's the second thing I was thinking, @royg ... but I think that they need to first get the table added in the 'code' view ( without all the added <p> tags it adds 😏 ) ... otherwise any styling is just going to appear as text.

     

    Try adding a <style> tag and use CSS to style your table/header/rows to your body (or using compose outputs)

    I am hopeful that it won't need the styling, though, if the table is added there. 👍

  • RajSingh Profile Picture
    176 on at

    Thanks Guys, The style tag worked to align columns but how can I align the first column heading to left and also reduce the width of first column? Please see below the current output:

    RajSingh_0-1705926246782.png

     

  • Verified answer
    eliotcole Profile Picture
    4,363 Moderator on at

    @RajSingh ... I think you need to start poking through the W3 Schools site.

    CSS Tutorials

    They have a lot of helpful tools on how to do this, specifically in the table section, here.

     

    Did you switch to '</>' code view? I'm assuming that you did.

  • royg Profile Picture
    on at

    Also worth mentioning, not all styles apply - for example the alternate row colors cannot be applied with CSS. 

  • RajSingh Profile Picture
    176 on at

    Thanks Guys - My table looks much better now using CSS . 

  • eliotcole Profile Picture
    4,363 Moderator on at

    Glad you're sorted, @RajSingh !!

     

    I hope that you do not mind but I added the more 'in depth' solution to the answers so that if someone comes here with the same issue they will have more assistance. 👍

     


     

    Yeah, @royg, that's why I mentioned to do a StartPage search on allowed styles for Outlook. 👍


    @royg wrote:

    Also worth mentioning, not all styles apply - for example the alternate row colors cannot be applied with CSS. 


    Here's my quote:

    you can use a fair amount of CSS styles (do a StartPage search for what is allowed in Outlook)

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 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard