How to creating vertical HTML table from sharepoint to send it via email using power automate?

Anonymous
2024-03-05T12:07:55+00:00

I‘m trying to use html table using power automate and then send it via email. however, I need the table to show vertical, which will contain 2 columns, first column to be the header, and then the second one is the data output. I have the following screen shoot for my flow, which works well, except that the table shows horizontally, any idea?

Microsoft 365 and Office | SharePoint | For business | MacOS

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} votes

4 answers

Sort by: Most helpful
  1. Anonymous
    2024-03-05T17:34:06+00:00

    Hi Jack,

    Thank you for posting to Microsoft Community. We are glad to assist. We are looking into your situation and we will update the thread shortly.

    Appreciate your patience and understanding and thank for your time and cooperation.

    Sincerely,

    George | Microsoft Community Moderator

    0 comments No comments
  2. Anonymous
    2024-03-06T06:56:29+00:00

    Dear Jack,

    The built-in HTML action is only for the horizontal table not the vertical table and the CSS example code is generally applied to the horizontal table.

    You may use the custom html code to see the result.

    Here is the example code.

    <style>

    table {
    
        border-collapse: collapse;
    
    }
    
    td {
    
        border: 1px solid black;
    
        padding: 5px;
    
    }
    
    td:first-child {
    
        font-weight: bold;
    
    }
    
    td:nth-child(2) {
    
        border-left: none;
    
    }
    

    </style>

    <table>

    &lt;tbody&gt;
    
       &lt;table border="1" class="variant-table" &gt;
    

    <tr>

    <td style="background-color: #53B3AE;">TypeColumn</td>

            &lt;td&gt;@{outputs('Get\_item')?['body/TypeColumn/Value']}&lt;/td&gt;
    
        &lt;/tr&gt;
    
        &lt;tr&gt;
    
            &lt;td style="background-color: #53B3AE;"&gt;LocationColumn&lt;/td&gt;
    
            &lt;td&gt;@{outputs('Get\_item')?['body/LocationColumn/Value']}&lt;/td&gt;
    
        &lt;/tr&gt;
    
        &lt;tr&gt;
    
            &lt;td style="background-color: #53B3AE;"&gt;DepartmentColumn&lt;/td&gt;
    
            &lt;td&gt;@{outputs('Get\_item')?['body/DepartmentColumn/Value']}&lt;/td&gt;
    
        &lt;/tr&gt;
    
    &lt;/tbody&gt;
    

    </table>

    Flow:

    Result:

    Welcome to share any updates at your convenience.

    Thank you for your effort and time.

    Sincerely

    Cliff | Microsoft Community Moderator

    1 person found this answer helpful.
    0 comments No comments
  3. matt howell 3,496 Reputation points
    2024-03-06T17:47:21+00:00

    Probably easier just to create the table in the email html, then you can specify where in the table each piece of data goes.

    0 comments No comments
  4. Anonymous
    2024-03-07T01:02:39+00:00

    Dear Jack,

    Have you tried the suggestions above? May I know whether you need further help on this issue?

    Welcome to share any updates at your convenience.

    Thank you for your effort and time.

    Sincerely

    Cliff | Microsoft Community Moderator

    0 comments No comments