cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Phineas
Community Champion
Community Champion

Add Space to Compose Action HTML Code

I'm still in my "always be learning" mode.🤓

I'm using the highlighted portion of the code below in a compose to artificially add space between text.

It works but isn't the right tool for the job.

I want to add space between the text where the red verticle lines are shown at the top of the PDF so that it 'looks' columnized; Is there a better way to accomplish this task, without actually adding a 'table'?

<b>Cert/Qual:</b> @{triggerOutputs()?['body/Certification/Value']}&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<b>Expiration Date:</b>

Phineas_1-1669483516489.png

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

This is what I would suggest as the best outcome in this instance.

 

See flow below as a quick example. I'll go into each action.

grantjenkins_0-1669690123659.png

 

CSS is a Compose that has some styling for your Table.

grantjenkins_1-1669690214400.png

<style>
  table {
    font-family: arial, sans-serif;
    border-collapse: collapse;
    width: 100%;
  }

  td, th {
    text-align: left;
    padding: 15px 15px 15px 0;
  }
</style>

 

HTML is another Compose that contains the actual HTML. Note that you would replace the values with your actual content from your dynamic fields. You would also need to change the image URL to your actual image.

grantjenkins_2-1669690289861.png

 

<img src="https://www.w3schools.com/images/w3lynx_200.png" alt="" />
<h2><strong>TGG Logistics, LCC</strong></h2>
<h4><strong>New Employee Profile</strong></h4>
<hr>
<hr>

<table>
    <tbody>
        <tr>
            <td>
                <strong>Full Name:</strong> Joe Bloggs
            </td>
            <td>
                <strong>Member's Email:</strong> Joe.bloggs@email.com
            </td>
        </tr>
        <tr>
            <td>
                <strong>Shift Assigned:</strong> Day
            </td>
            <td>
                <strong>Security Level:</strong> High
            </td>
        </tr>
        <tr>
            <td>
                <strong>Supervisor's Name:</strong> Jane Doe
            </td>
            <td>
                <strong>Supervisor's Email:</strong> Jane.Doe@email.com
            </td>
        </tr>
        <tr>
            <td>
                <strong>Notification Email Sent:</strong> No
            </td>
            <td>
                
            </td>
        </tr>
    </tbody>
</table>

 

Then you would just need to include the CSS and HTML in your output. In this example I'm using Send an email.

grantjenkins_3-1669690407049.png

 

The email would look something like the screenshot below:

grantjenkins_4-1669690461978.png

 


----------------------------------------------------------------------
If I've answered your question, please mark the post as Solved.
If you like my response, please consider giving it a Thumbs Up.

View solution in original post

24 REPLIES 24

Can you try embedding your code inside <pre>YOUR HTML</pre> to see if that keeps the tabs you've added without collapsing the spacing. Not sure if this will work as you expect, but worth a shot.

 

For example:

 

<pre><b>Cert/Qual:</b> @{triggerOutputs()?['body/Certification/Value']}&nbsp; &nbsp; &nbsp;<b>Expiration Date:</b></pre>

 

 


----------------------------------------------------------------------
If I've answered your question, please mark the post as Solved.
If you like my response, please consider giving it a Thumbs Up.

Edited Reply: See bottom for update

That did impact the content.
Phineas_1-1669567128818.png

 

The line with full name is with the 'pre' you suggested.

The six spaces are there (between the last name 'Jack' and 'Member's', but the font no longer matches the rest.

Phineas_2-1669567251972.png



Edit: I went back and removed all the &nbsp; language and the spaces now show as desired. It's of an awkward process but I did manage to get the look I want.

However, I have lost control of the original font size and type. The pre changed the font. How do I regain control of font size and type?

Phineas_0-1669571618626.png

 

Phineas_1-1669571718853.png

 

Hi @Phineas ,

If you want the content fonts in Pre to be the same,

Please try :

 <pre style="font-size: 20px; font-family: 'Times New Roman', Times, serif;">

If you want to set the font yourself.

Please try:

<font size="24">Your Text</font>

Here are some links for your reference:

Font family (HTML) - CodeDocs

How to change the font size in HTML? - GeeksforGeeks

 

Best Regards

Cheng Feng

Or another option would be to add some CSS for the pre tag. You would add the CSS in your Compose - HTML Content just above the Output. This would apply the style across all of your pre tags.

 

<style>
pre {
  font-size: 20px;
  font-family: 'Times New Roman', Times, serif;
}
</style>

----------------------------------------------------------------------
If I've answered your question, please mark the post as Solved.
If you like my response, please consider giving it a Thumbs Up.

Thank you, I'll try both just so I can confirm and know.

 

I was also trying to incorporate an employee specific image above or adjacent to the content impacted by the  'pre' command.

 

As these things kinda go together should such language be in the same compose for the 'pre' or should there be separate code, and what should that code be?

 

I DO have a separate question already in the system on this image issue. I've successfully hard-coded in the single image (the company logo in the header), however I can't figure out how to code for a dynamic image of each employee based on the 'Fullname'.

 

Each line in the SP List has a separate image in 'CompanyLogo', and each of those same images is loaded into a SP Library, as I'm unsure of best practices in this regard - though I believe placinf the images in a library is recommended.

 

Any thoughts?

I tried the following. No change in the spacing.

Phineas_0-1669649622415.png

Phineas_1-1669649654625.png

 

Hi @Phineas ,

 Please inline your stylesheets. Most clients will either erase the stylesheet or rewrite it.

Here is a test for your reference:

vchengfenmsft_1-1669685951047.png

Here is result:

vchengfenmsft_2-1669685994984.png

 

 

html - CSS not showing in outlook - Stack Overflow

Outlook Email Rendering Issues and How to Solve Them - Litmus

 

Best Regards

Cheng Feng

 

Thank you for the reply.

 

If I may ask, it seems that the spacing will still be content dependent.

 

For example, the length and spacing of each line will be dependent upon the content of the 'label' and the content of the 'field' from the data source, yes?

 

Meaning, using this dynamic method will not allow for uniformity in spacing, yes?

 

if the above is true, is there a way to ensure the second set of label/field line up vertically everytime - as if there were two columns and the second set of content on each line line starts at the same spot?

The idea was to add the style/css in addition to still keeping your <pre> tags around your content. The style/css would style any pre tags it found with the styles you put (font-size, font-family, etc.)

 

I would actually suggest a better option would be to put everything into another table set to width of 100% and remove the borders. This would ensure everything looked uniform regardless of length of values, etc.


----------------------------------------------------------------------
If I've answered your question, please mark the post as Solved.
If you like my response, please consider giving it a Thumbs Up.

This is what I would suggest as the best outcome in this instance.

 

See flow below as a quick example. I'll go into each action.

grantjenkins_0-1669690123659.png

 

CSS is a Compose that has some styling for your Table.

grantjenkins_1-1669690214400.png

<style>
  table {
    font-family: arial, sans-serif;
    border-collapse: collapse;
    width: 100%;
  }

  td, th {
    text-align: left;
    padding: 15px 15px 15px 0;
  }
</style>

 

HTML is another Compose that contains the actual HTML. Note that you would replace the values with your actual content from your dynamic fields. You would also need to change the image URL to your actual image.

grantjenkins_2-1669690289861.png

 

<img src="https://www.w3schools.com/images/w3lynx_200.png" alt="" />
<h2><strong>TGG Logistics, LCC</strong></h2>
<h4><strong>New Employee Profile</strong></h4>
<hr>
<hr>

<table>
    <tbody>
        <tr>
            <td>
                <strong>Full Name:</strong> Joe Bloggs
            </td>
            <td>
                <strong>Member's Email:</strong> Joe.bloggs@email.com
            </td>
        </tr>
        <tr>
            <td>
                <strong>Shift Assigned:</strong> Day
            </td>
            <td>
                <strong>Security Level:</strong> High
            </td>
        </tr>
        <tr>
            <td>
                <strong>Supervisor's Name:</strong> Jane Doe
            </td>
            <td>
                <strong>Supervisor's Email:</strong> Jane.Doe@email.com
            </td>
        </tr>
        <tr>
            <td>
                <strong>Notification Email Sent:</strong> No
            </td>
            <td>
                
            </td>
        </tr>
    </tbody>
</table>

 

Then you would just need to include the CSS and HTML in your output. In this example I'm using Send an email.

grantjenkins_3-1669690407049.png

 

The email would look something like the screenshot below:

grantjenkins_4-1669690461978.png

 


----------------------------------------------------------------------
If I've answered your question, please mark the post as Solved.
If you like my response, please consider giving it a Thumbs Up.

Perfect!

The last item is how to get the employee image in-line with the text - maybe above the fullname (first line of text).

I have a separate question here in the forum that is about adding a 'dynamic' image to the html.

I've been able to achieve this with a 'static' image. The header image, like yours, work fine; In case you want to see the 'compose' and 'get file content' for that image it is in my other question.

However, I have not been able to figure out how to get a 'dynamic' image, based on the 'fullname' to appear in the html output.

Do you have any suggestions?

Perfect!

The last item is how to get the employee image in-line with the text - maybe above the fullname (first line of text).

I have a separate question here in the forum that is about adding a 'dynamic' image to the html.

I've been able to achieve this with a 'static' image. The header image, like yours, work fine; In case you want to see the 'compose' and 'get file content' for that image it is in my other question.

However, I have not been able to figure out how to get a 'dynamic' image, based on the 'fullname' to appear in the html output.

Do you have any suggestions?

Are you able to show the list/library that contains the images? Also, what is the datatype of the column that has the images?


----------------------------------------------------------------------
If I've answered your question, please mark the post as Solved.
If you like my response, please consider giving it a Thumbs Up.

Edited Reply: 

Getting close. I just need to figure out how to stop the two different 'styles' from impacting each other.

The 'Profile' section should have two left-justified columns with no borders.

Phineas_9-1669748292470.png

 

 

1 = Header Image Compose
2 = The short CSS you provided for the columns in the profile section
3 = The CSS for the Table (this is where the orange boarder code is located)
4 = HTML table with certs and quals data

Phineas_6-1669747889091.png

Can you see if modifying the following for the first table solves the issue. You'll need to put #MembersTable where specified.

 

grantjenkins_0-1670075476565.png

 

I'll reply to your other post with further updates, including the dynamic image.

Assistance with PDF HTML (Boarders and Dynamic Ima... - Power Platform Community (microsoft.com)


----------------------------------------------------------------------
If I've answered your question, please mark the post as Solved.
If you like my response, please consider giving it a Thumbs Up.

I believe I figured out the 'dynamic' image.

I replaced the hardcoded employee name in the variable with the 'Fullname' column from the 'When an item...' trigger. It seems to be working.

Everything else is working with you updates added except the employee data at the top; There should NOT be any color to the borders. Orange boarders should only appear around the 'Certification' table at the bottom.

Phineas_0-1670098637479.png

 

Are you able to show the CSS styling you have for the second table?


----------------------------------------------------------------------
If I've answered your question, please mark the post as Solved.
If you like my response, please consider giving it a Thumbs Up.

Can you update your CSS for the first table to this:

<style>
  #MembersTable {
    font-family: arial, sans-serif;
    border-collapse: collapse;
    width: 100%;
  }

  #MembersTable td, #MembersTable th {
    text-align: left;
    padding: 15px 15px 15px 0;
    border: none;
  }
</style>

 

Then just make sure your first Table has the following ID to match the CSS.

<table id="MembersTable">

grantjenkins_0-1670111202888.png

 


----------------------------------------------------------------------
If I've answered your question, please mark the post as Solved.
If you like my response, please consider giving it a Thumbs Up.

Here is what I have.

Output is the same.

1 - Compose - CSS (the other two are for the images)

Phineas_0-1670111899406.png

 

Helpful resources

Announcements

Community will be READ ONLY July 16th, 5p PDT -July 22nd

Dear Community Members,   We'd like to let you know of an upcoming change to the community platform: starting July 16th, the platform will transition to a READ ONLY mode until July 22nd.   During this period, members will not be able to Kudo, Comment, or Reply to any posts.   On July 22nd, please be on the lookout for a message sent to the email address registered on your community profile. This email is crucial as it will contain your unique code and link to register for the new platform encompassing all of the communities.   What to Expect in the New Community: A more unified experience where all products, including Power Apps, Power Automate, Copilot Studio, and Power Pages, will be accessible from one community.Community Blogs that you can syndicate and link to for automatic updates. We appreciate your understanding and cooperation during this transition. Stay tuned for the exciting new features and a seamless community experience ahead!

Summer of Solutions | Week 4 Results | Winners will be posted on July 24th

We are excited to announce the Summer of Solutions Challenge!    This challenge is kicking off on Monday, June 17th and will run for (4) weeks.  The challenge is open to all Power Platform (Power Apps, Power Automate, Copilot Studio & Power Pages) community members. We invite you to participate in a quest to provide solutions to as many questions as you can. Answers can be provided in all the communities.    Entry Period: This Challenge will consist of four weekly Entry Periods as follows (each an “Entry Period”)   - 12:00 a.m. PT on June 17, 2024 – 11:59 p.m. PT on June 23, 2024 - 12:00 a.m. PT on June 24, 2024 – 11:59 p.m. PT on June 30, 2024 - 12:00 a.m. PT on July 1, 2024 – 11:59 p.m. PT on July 7, 2024 - 12:00 a.m. PT on July 8, 2024 – 11:59 p.m. PT on July 14, 2024   Entries will be eligible for the Entry Period in which they are received and will not carryover to subsequent weekly entry periods.  You must enter into each weekly Entry Period separately.   How to Enter: We invite you to participate in a quest to provide "Accepted Solutions" to as many questions as you can. Answers can be provided in all the communities. Users must provide a solution which can be an “Accepted Solution” in the Forums in all of the communities and there are no limits to the number of “Accepted Solutions” that a member can provide for entries in this challenge, but each entry must be substantially unique and different.    Winner Selection and Prizes: At the end of each week, we will list the top ten (10) Community users which will consist of: 5 Community Members & 5 Super Users and they will advance to the final drawing. We will post each week in the News & Announcements the top 10 Solution providers.  At the end of the challenge, we will add all of the top 10 weekly names and enter them into a random drawing.  Then we will randomly select ten (10) winners (5 Community Members & 5 Super Users) from among all eligible entrants received across all weekly Entry Periods to receive the prize listed below. If a winner declines, we will draw again at random for the next winner.  A user will only be able to win once overall. If they are drawn multiple times, another user will be drawn at random.  Individuals will be contacted before the announcement with the opportunity to claim or deny the prize.  Once all of the winners have been notified, we will post in the News & Announcements of each community with the list of winners.   Each winner will receive one (1) Pass to the Power Platform Conference in Las Vegas, Sep. 18-20, 2024 ($1800 value). NOTE: Prize is for conference attendance only and any other costs such as airfare, lodging, transportation, and food are the sole responsibility of the winner. Tickets are not transferable to any other party or to next year’s event.   ** PLEASE SEE THE ATTACHED RULES for this CHALLENGE**   Week 1 Results: Congratulations to the Week 1 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge.   Community MembersNumber SolutionsSuper UsersNumber Solutions Deenuji 9 @NathanAlvares24  17 @Anil_g  7 @ManishSolanki  13 @eetuRobo  5 @David_MA  10 @VishnuReddy1997  5 @SpongYe  9JhonatanOB19932 (tie) @Nived_Nambiar  8 @maltie  2 (tie)   @PA-Noob  2 (tie)   @LukeMcG  2 (tie)   @tgut03  2 (tie)       Week 2 Results: Congratulations to the Week 2 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 2: Community MembersSolutionsSuper UsersSolutionsPower Automate  @Deenuji  12@ManishSolanki 19 @Anil_g  10 @NathanAlvares24  17 @VishnuReddy1997  6 @Expiscornovus  10 @Tjan  5 @Nived_Nambiar  10 @eetuRobo  3 @SudeepGhatakNZ 8     Week 3 Results: Congratulations to the Week 3 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 3:Community MembersSolutionsSuper UsersSolutionsPower Automate Deenuji32ManishSolanki55VishnuReddy199724NathanAlvares2444Anil_g22SudeepGhatakNZ40eetuRobo18Nived_Nambiar28Tjan8David_MA22   Week 4 Results: Congratulations to the Week 4 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 4:Community MembersSolutionsSuper UsersSolutionsPower Automate Deenuji11FLMike31Sayan11ManishSolanki16VishnuReddy199710creativeopinion14Akshansh-Sharma3SudeepGhatakNZ7claudiovc2CFernandes5 misc2Nived_Nambiar5 Usernametwice232rzaneti5 eetuRobo2   Anil_g2   SharonS2  

Check Out | 2024 Release Wave 2 Plans for Microsoft Dynamics 365 and Microsoft Power Platform

On July 16, 2024, we published the 2024 release wave 2 plans for Microsoft Dynamics 365 and Microsoft Power Platform. These plans are a compilation of the new capabilities planned to be released between October 2024 to March 2025. This release introduces a wealth of new features designed to enhance customer understanding and improve overall user experience, showcasing our dedication to driving digital transformation for our customers and partners.    The upcoming wave is centered around utilizing advanced AI and Microsoft Copilot technologies to enhance user productivity and streamline operations across diverse business applications. These enhancements include intelligent automation, AI-powered insights, and immersive user experiences that are designed to break down barriers between data, insights, and individuals. Watch a summary of the release highlights.    Discover the latest features that empower organizations to operate more efficiently and adaptively. From AI-driven sales insights and customer service enhancements to predictive analytics in supply chain management and autonomous financial processes, the new capabilities enable businesses to proactively address challenges and capitalize on opportunities.    

Updates to Transitions in the Power Platform Communities

We're embarking on a journey to enhance your experience by transitioning to a new community platform. Our team has been diligently working to create a fresh community site, leveraging the very Dynamics 365 and Power Platform tools our community advocates for.  We started this journey with transitioning Copilot Studio forums and blogs in June. The move marks the beginning of a new chapter, and we're eager for you to be a part of it. The rest of the Power Platform product sites will be moving over this summer.   Stay tuned for more updates as we get closer to the launch. We can't wait to welcome you to our new community space, designed with you in mind. Let's connect, learn, and grow together.   Here's to new beginnings and endless possibilities!   If you have any questions, observations or concerns throughout this process please go to https://aka.ms/PPCommSupport.   To stay up to date on the latest details of this migration and other important Community updates subscribe to our News and Announcements forums: Copilot Studio, Power Apps, Power Automate, Power Pages

Users online (1,819)