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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Format HTML table indi...
Power Automate
Unanswered

Format HTML table individual columns

(1) ShareShare
ReportReport
Posted on by 308

Hi Power Automate community,

 

I have a flow that get items from a SharePoint list and send an email with those items to a specific user.

 

JB0007_2-1632769549756.png    JB0007_3-1632769581010.png

 

In the Format Compose, I am using the CSS of Ryan Maclean in order to format the tables as below:

JB0007_1-1632769316503.png

The problem is that the tables are returned in different styles. For example, each table has a different column width and I want to prevent that. 

 

I don't know if there is a way that I can determine the columns width of the tables. For example, I want the Task Number shorter and the Task and Comments columns wider.

 

Can someone please help me? 

There are some columns that doesn't contain long sentences and I want to set a fixed width for those columns.

 

Categories:
  • VJR Profile Picture
    7,635 on at

    Hi @JB0007 

     

    Are you able to set the width of the individual columns in the below section.

     

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

     

    VJR_0-1632816972066.png

     

     

    If not also please check the concept of n-th child.

    https://stackoverflow.com/questions/40134586/how-to-set-different-column-in-table-to-be-different-width-in-css

    Click on "Run code snippet" button under each of the answers given in the above link

  • JB0007 Profile Picture
    308 on at

    Hi @VJR ,

     

    Thank you for your feedback, I have tried the code but the table stayed the same:

     

    JB0007_1-1632835004344.png

     

    JB0007_2-1632835057514.png

     

    Output:

    JB0007_3-1632835102828.png

     

     

  • Nestedune Profile Picture
    4 on at

    Hi @JB0007 

    I am having the same issue - have you solve your issue on column width?

     

     

  • JB0007 Profile Picture
    308 on at

    @Nestedune 

     

    Yes, I have used the Select action and passed the HTML / CSS code for each data in the Select columns.

     

    JB0007_0-1668078898966.png

     

  • CW Profile Picture
    1,044 on at

    That doesn't work. It only returns as text, not the intended formatting.

  • GuMean Profile Picture
    77 on at

    Thanks for this. @JB0007 
    I have used the code that you have in the Select action, followed by these steps below. However, the HTML table has a gap between the two columns that are in my table. I think the issue is in the Clean HTML action. Would you be able to provide the code that you used in Clean HTML action and the Format HTML action? I think this is where my issue is.

    GuMean_0-1698827984583.png

     

    Clean HTML code:
    replace(replace(replace(replace(replace(body('Create_HTML_table'), '&lt;', '<'), '&gt;', '>'), '&amp;', '&'), '&#39;', '"'), '&quot;', '"')
    
    Format HTML code:
    <style>
    table {
     border: 1px solid #1C6EA4;
     background-color: #EEEEEE;
     width: 60%;
     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: #24387F;
     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;
    }
    </style>

     

  • GuMean Profile Picture
    77 on at

    I think that you need to 'Clean' the HTML in the Create HTML table action.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 289

#2
11manish Profile Picture

11manish 288 Super User 2026 Season 2

#3
Henil Profile Picture

Henil 125

Last 30 days Overall leaderboard