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

Community site session details

Session Id : Eh5zZV9t7CULwG8D+P/7/h
Power Automate - Building Flows
Answered

HTML Column Width Alignment and Formatting

Like (1) ShareShare
ReportReport
Posted on 20 May 2025 15:33:47 by 1,252
I have a Flow based on a SharePoint list.  There are (10) columns but I would like for the columns to have different alignments.  Columns 8, 9 and 10 are numeric so I would like to them the be aligned to the right (I would also like all to have two decimal places).  Regardless, I have the output working correctly but not the formatting.  I have worked with the CSS but have been unable to modify.  Is Power Automate limited in the method to format this information or are multiple alignments possible?  The current CSS information is identified at the end.  Please note that the CSS only deals with the first (3) columns (I was trying to get those to work prior to addressing all (10)
 
If possible, I would like the following...
Column 1:  Center-Align
Column 2:  Center-Align
Column 3:  Center-Align
Column 4:  Left-Align
Column 5:  Left-Align
Column 6:  Center-Align
Column 7:  Center-Align
Column 8:  Right-Align
Column 9:  Right-Align
Column 10:  Right-Align
 
I have the same question (0)
  • stampcoin Profile Picture
    4,428 Super User 2025 Season 2 on 20 May 2025 at 17:29:15
    HTML Column Width Alignment and Formatting
    @RJF61 Hi,
    It doesn't make too much sense for styling within Create HTML table action, before the data flow to the destination, you can try to compose the output with styling, and send it via email to check the appearance of the table.
  • David_MA Profile Picture
    12,515 Super User 2025 Season 2 on 20 May 2025 at 17:30:04
    HTML Column Width Alignment and Formatting
    Please share how your post is related to Power Automate. If you've developed a flow, share what you've done so we have a better understanding of what you are attempting to achieve. If you're just asking how to change the CSS of a SharePoint site, you will have a better chance of getting an answer in the SharePoint forums at SharePoint | Microsoft Community Hub
  • RJF61 Profile Picture
    1,252 on 20 May 2025 at 18:00:43
    HTML Column Width Alignment and Formatting
    Hello @David_MA
     
    Thanks for the response.  Following is the Flow I am using.  As shown, performing Get Items from SharePoint List.  Then creating an HTML table with the CSS previously posted.  What I am trying to accomplish is "centering" info in columns 1, 2, 3, 6 and 7.  I would like "left alignment" in columns 4 and 5 and "right alignment" in 8, 9 and 10. 
     
     
  • Verified answer
    David_MA Profile Picture
    12,515 Super User 2025 Season 2 on 21 May 2025 at 15:03:34
    HTML Column Width Alignment and Formatting
    To do what you want, I believe you'll need to manually generate the table instead of using the Create HTML table action. I am guessing the apply to each action is the data source for all of the rows. If so:
    • Create a string variable in your flow and set the default value with the start table and th tags. For example, this portion of the table:
    <table>
      <thead>
        <tr>
          <th style="text-align: center;">Header 1</th>
          <th style="text-align: center;">Header 2</th>
        </tr>
      </thead>
      <tbody>
     
    • Then in the apply to each, use an append to string action to add each of the rows. For the cells where you want the text centered or any other styling, use inline styles like below:
     
        <tr>
          <td style="text-align: center;">Centered Text 1</td>
          <td style="text-align: center;">Centered Text 2</td>
        </tr>
     
    • Finally, outside of the apply to each, add an append to string variable with the tags to close the table.
     
      </tbody>
    </table>
    Maybe someone has figured out a better way, but when I need to have precise control over the formatting of the table data, this is the method I use.
  • RJF61 Profile Picture
    1,252 on 28 May 2025 at 16:16:36
    HTML Column Width Alignment and Formatting
    Hello @
     
    This was very helpful!  Thanks.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 655 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 371 Moderator

#3
chiaraalina Profile Picture

chiaraalina 276

Last 30 days Overall leaderboard