cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MIA27
Post Prodigy
Post Prodigy

How to send email with Tabular Looks of the output

I am trying to export the records of the Sharepoint list , when an item is created or modified , the output result is ok but the output data format is not looking, I need the looks as below:

 

MIA27_2-1658660040685.png

 

I used the below Html code , which I found from website search

<style>
Table {
font-family: Arial, Helvetica, sans-serif;
background-color: #EEEEEE;
border-collapse: collapse;
width: 100%;
}
Table td, Table th {
border: 1px solid #ddd;
padding: 3px 3px;
}
Table th {
font-size: 15px;
font-weight: bold;
padding-top: 12px;
padding-bottom: 12px;
text-align: left;
background-color: #1C6EA4;
color: white;
}
</style>

 

But it not formatting properly and also it is getting mess with my auto signature

 

My Flow is as below:

 

 

MIA27_1-1658659869642.png

 

Kindly check and advise

 

 

 

5 ACCEPTED SOLUTIONS

Accepted Solutions
v-yujincui-msft
Community Support
Community Support

Hi @MIA27 ,

 

Do you want to generate a multi-row, two-column HTML table with borders based on the current item and send it by email?

 

I have made a simple test for your reference.

 

Here is my Flow.

<!DOCTYPE html>
<html>
<head>
<style>
table {
  border: 1px solid #1C6EA4;
  background-color: #EEEEEE;
  width: 100%;
  text-align: left;
  border-collapse: collapse;
}
table td, table th {
  border: 1px solid #AAAAAA;
  padding: 3px 2px;
}
td:nth-child(odd) {
  background-color: #dddddd;
}
</style>
</head>
<body>
<table>
  <tr>
    <td>ColumnName1</td>
    <td>DynamicContent1</td>
  </tr>
  <tr>
    <td>ColumnName2</td>
    <td>DynamicContent2</td>
  </tr>
  <tr>
    <td>ColumnName3</td>
    <td>DynamicContent3</td>
  </tr>
  <tr>
    <td>ColumnName4</td>
    <td>DynamicContent4</td>
  </tr>
  <tr>
    <td>ColumnName5</td>
    <td>DynamicContent5</td>
  </tr>
</table>
</body>
</html>

vyujincuimsft_0-1658988775779.png

vyujincuimsft_1-1658988823437.png

Result Screenshot:

vyujincuimsft_2-1658989018284.png

 

 

Best Regards,
Charlie Choi

View solution in original post

v-yujincui-msft
Community Support
Community Support

Hi @MIA27 ,

 

Maybe you could try the following Codes. I used class attribute in code.

<!DOCTYPE html>
<html>
<head>
<style>
table.tb1 {
  border: 1px solid #1C6EA4;
  background-color: #EEEEEE; 
  text-align: left;
  border-collapse: collapse;
}
table.tb1 td, table.tb1 th {
  border: 1px solid #AAAAAA;
  padding: 3px 2px;
}
table.tb1 td {
  width: 25%;
}	
table.tb1 td:nth-child(odd) {
  background-color: #dddddd;
}
</style>
</head>
<body>
<table class="tb1">
  <tr>
    <td>ColumnName1</td>
    <td>DynamicContent1</td>
  </tr>
  <tr>
    <td>ColumnName2</td>
    <td>DynamicContent2</td>
  </tr>
  <tr>
    <td>ColumnName3</td>
    <td>DynamicContent3</td>
  </tr>
  <tr>
    <td>ColumnName4</td>
    <td>DynamicContent4</td>
  </tr>
  <tr>
    <td>ColumnName5</td>
    <td>DynamicContent5</td>
  </tr>
</table>
</body>
</html>

 

 

Best Regards,
Charlie Choi

View solution in original post

v-yujincui-msft
Community Support
Community Support

Hi @MIA27 ,

 

The HTML table generated by the code I provided earlier should have borders. in addition, here is the latest code:

<!DOCTYPE html>
<html>
<head>
<style>
table.tb1 {
  border: 1px solid #1C6EA4;
  background-color: #EEEEEE; 
  text-align: left;
  border-collapse: collapse;
}
table.tb1 td, table.tb1 th {
  border: 1px solid #AAAAAA;
  padding: 3px 2px;
}
table.tb1 td {
  width: 25%;
}	
.td1 {
  background-color: #1C6EA4;
  text-align:center;
  color:#FFFFFF
}
</style>
</head>
<body>
<table class="tb1">
  <tr>
    <td class="td1">ID</td>
    <td>TestValue1</td>
  </tr>
  <tr>
    <td class="td1">Title</td>
    <td>TestValue2</td>
  </tr>
  <tr>
    <td class="td1">Product Description</td>
    <td>TestValue3</td>
  </tr>
  <tr>
    <td class="td1">Qty</td>
    <td>TestValue4</td>
  </tr>
  <tr>
    <td class="td1">Status</td>
    <td>TestValue5</td>
  </tr>
</table>
</body>
</html>

Result Screenshot:

vyujincuimsft_1-1659079407522.png

 

 

Best Regards,

Charlie Choi

View solution in original post

v-yujincui-msft
Community Support
Community Support

Hi @MIA27 ,

 

Your HTML Code looks fine.

In addition, do you want to improve the readability of your code in your post? If so, you could paste the code in the code box.

<!DOCTYPE html>
<html>
<head>
<style>

vyujincuimsft_0-1659321567473.png

vyujincuimsft_1-1659321673531.png

 

 

Best Regards,
Charlie Choi

View solution in original post

14 REPLIES 14
Hardesh15
Super User
Super User

@MIA27  Use this style-

<style>
Table {
font-family: Arial, Helvetica, sans-serif;
background-color: #EEEEEE;
border-collapse: collapse;
}
Table td, Table th {
border: 1px solid #ddd;
padding: 3px 3px;
text-align: center;
}
Table th {
font-size: 15px;
font-weight: bold;
padding-top: 12px;
padding-bottom: 12px;
}
</style>

Please 'Thumbs Up' the posts that helped you and 'Accept as Solution' if my post answered your question.

@Hardesh /Gopenly.in

Dear Mr. Haresh,

Thank you for your reply.

In my situation it is not getting applied.

 

Reason what I can understand that code is ok, but for me as the my IT people has set up auto signature which is creating the mess of my email, the code is trying to format the signature section also.

 

Therefore, change the plan and send the records one by one. 

so applied the below method, 

 

Is it possible to format the below email style, if yes please guide

 

MIA27_0-1658771566197.png

 

My current requirement will be as below

 

MIA27_1-1658771686952.png

 

v-yujincui-msft
Community Support
Community Support

Hi @MIA27 ,

 

Do you want to generate a multi-row, two-column HTML table with borders based on the current item and send it by email?

 

I have made a simple test for your reference.

 

Here is my Flow.

<!DOCTYPE html>
<html>
<head>
<style>
table {
  border: 1px solid #1C6EA4;
  background-color: #EEEEEE;
  width: 100%;
  text-align: left;
  border-collapse: collapse;
}
table td, table th {
  border: 1px solid #AAAAAA;
  padding: 3px 2px;
}
td:nth-child(odd) {
  background-color: #dddddd;
}
</style>
</head>
<body>
<table>
  <tr>
    <td>ColumnName1</td>
    <td>DynamicContent1</td>
  </tr>
  <tr>
    <td>ColumnName2</td>
    <td>DynamicContent2</td>
  </tr>
  <tr>
    <td>ColumnName3</td>
    <td>DynamicContent3</td>
  </tr>
  <tr>
    <td>ColumnName4</td>
    <td>DynamicContent4</td>
  </tr>
  <tr>
    <td>ColumnName5</td>
    <td>DynamicContent5</td>
  </tr>
</table>
</body>
</html>

vyujincuimsft_0-1658988775779.png

vyujincuimsft_1-1658988823437.png

Result Screenshot:

vyujincuimsft_2-1658989018284.png

 

 

Best Regards,
Charlie Choi

Dear Charlie,

 

Thank you for your advise code, it worked, but it is applying the formatting on the signature also.

Kindly below note in the image posted

My IT teams has set the auto signature for every new email, which I cannot remove also to test it. 

I dont want the format to be applied on the below signature and Also the width to be controlled as it is on the whole page, 

Please guide how to solve both:

 

MIA27_0-1659004879039.png

 

 

 

v-yujincui-msft
Community Support
Community Support

Hi @MIA27 ,

 

Maybe you could try the following Codes. I used class attribute in code.

<!DOCTYPE html>
<html>
<head>
<style>
table.tb1 {
  border: 1px solid #1C6EA4;
  background-color: #EEEEEE; 
  text-align: left;
  border-collapse: collapse;
}
table.tb1 td, table.tb1 th {
  border: 1px solid #AAAAAA;
  padding: 3px 2px;
}
table.tb1 td {
  width: 25%;
}	
table.tb1 td:nth-child(odd) {
  background-color: #dddddd;
}
</style>
</head>
<body>
<table class="tb1">
  <tr>
    <td>ColumnName1</td>
    <td>DynamicContent1</td>
  </tr>
  <tr>
    <td>ColumnName2</td>
    <td>DynamicContent2</td>
  </tr>
  <tr>
    <td>ColumnName3</td>
    <td>DynamicContent3</td>
  </tr>
  <tr>
    <td>ColumnName4</td>
    <td>DynamicContent4</td>
  </tr>
  <tr>
    <td>ColumnName5</td>
    <td>DynamicContent5</td>
  </tr>
</table>
</body>
</html>

 

 

Best Regards,
Charlie Choi

Dear Charlie,

 

Thank you so much,

it worked. Below is the image of the output in email. For testing I only inserted the Dynamic field only.

 

But One additional advise to show perfection in the output and learn more (which will help me to apply in other flows also), Is it possible to put border and font colors in the output as it not good readable and getting mixed.

 

Current output in email

MIA27_0-1659069934312.png

 

Required is the below output to bring good looks (some formatting also please note background color, font color, allignement etc)

 

MIA27_2-1659070358287.png

 

 

Best Regards.

 

v-yujincui-msft
Community Support
Community Support

Hi @MIA27 ,

 

The HTML table generated by the code I provided earlier should have borders. in addition, here is the latest code:

<!DOCTYPE html>
<html>
<head>
<style>
table.tb1 {
  border: 1px solid #1C6EA4;
  background-color: #EEEEEE; 
  text-align: left;
  border-collapse: collapse;
}
table.tb1 td, table.tb1 th {
  border: 1px solid #AAAAAA;
  padding: 3px 2px;
}
table.tb1 td {
  width: 25%;
}	
.td1 {
  background-color: #1C6EA4;
  text-align:center;
  color:#FFFFFF
}
</style>
</head>
<body>
<table class="tb1">
  <tr>
    <td class="td1">ID</td>
    <td>TestValue1</td>
  </tr>
  <tr>
    <td class="td1">Title</td>
    <td>TestValue2</td>
  </tr>
  <tr>
    <td class="td1">Product Description</td>
    <td>TestValue3</td>
  </tr>
  <tr>
    <td class="td1">Qty</td>
    <td>TestValue4</td>
  </tr>
  <tr>
    <td class="td1">Status</td>
    <td>TestValue5</td>
  </tr>
</table>
</body>
</html>

Result Screenshot:

vyujincuimsft_1-1659079407522.png

 

 

Best Regards,

Charlie Choi

I copied the complete final code from your last posting, I tested the code, all the fine other than border, no border, but in image border is there. 

 

MIA27_0-1659095097785.png

please advise which line to revise, so that the border can appear.

 

Regards

 

Dear Charlie,

 

Further to not 100% result, started tested and adding lines. As I am very new to this coding, after making mess codes, found the below code worked and brought the result as I wanted.

But I am fully sure, that I have added few extra lines which may can be revised to be better.

The additional method I applied, that I added one more class .td2 as you did to capture the value of column related rows and some padding code as well. Not sure If I am ok and there will no further code failure later.

 

Requesting you to review my code and advise me,  it help me to learn and use in further need.

 

Applied code is as below :

<!DOCTYPE html>
<html>
<head>
<style>
table.tb1 {
  border: 1px solid #1C6EA4;
  background-color: #B2B2B2; 
  text-align: left;
 
font-size:15px;
font-family:calibri;
padding: 3px 2px;
}
table.tb1 td, table.tb1 th {
  border: 1px solid #1C6EA4;
  padding: 3px 2px;
}
table.tb1 td {
  width: 25%;
}       
.td1 {
  background-color: #1C6EA4;
  text-align:center;
  color:#FFFFFF
}
.td2 {
  background-color: rgb(255,255,255);
  text-align:left;
  color:Black
}
</style>
</head>
<body>
<table class="tb1">
  <tr>
    <td class="td1">FormNo       :</td>
    <td class="td2">TestValue1</td>
  </tr>
  <tr>
    <td class="td1">Model          :</td>
    <td class="td2">TestValue2</td>
  </tr>
  <tr>
    <td class="td1">SerialNo      :</td>
    <td class="td2">TestValue3</td>
  </tr>
  <tr>
    <td class="td1">ProdType    :</td>
    <td class="td2">TestValue4</td>
  </tr>
  <tr>
    <td class="td1">AssetNo      :</td>
    <td class="td2">TestValue5</td>
  </tr>
</table>
</body>
</html>

 

 

The result is as below:

MIA27_0-1659179994355.png

 

sorry,

I added to my reply to earlier reply.

Should I clicked on your post to reply.

anyhow, please check the trailing post and advise.

 

Also plls. advise where to type these codes when copied and pasted in compose it remains same colors coding, same as yours. 

 

Best regards.

v-yujincui-msft
Community Support
Community Support

Hi @MIA27 ,

 

Your HTML Code looks fine.

In addition, do you want to improve the readability of your code in your post? If so, you could paste the code in the code box.

<!DOCTYPE html>
<html>
<head>
<style>

vyujincuimsft_0-1659321567473.png

vyujincuimsft_1-1659321673531.png

 

 

Best Regards,
Charlie Choi

Dear Charlie,

Thank you so much for your review and advise, which is helping to learn more.

I applied the code in my project.

 

Can you please guide any link where I can learn more about the html related to table.

I saw some, formatting of tables is also there.

But from you I learn the declaration of class and then linking it later in the lower code.

Was looking, some tutorials links, where these types code with example are there, this will help me to learn more and understand each lines of the code before writing.

 

Thanking you once for time.

Best regards

 

v-yujincui-msft
Community Support
Community Support

Thank you Sir,

Best Regards.

Helpful resources

Announcements

Celebrating the May Super User of the Month: Laurens Martens

  @LaurensM  is an exceptional contributor to the Power Platform Community. Super Users like Laurens inspire others through their example, encouragement, and active participation. We are excited to celebrated Laurens as our Super User of the Month for May 2024.   Consistent Engagement:  He consistently engages with the community by answering forum questions, sharing insights, and providing solutions. Laurens dedication helps other users find answers and overcome challenges.   Community Expertise: As a Super User, Laurens plays a crucial role in maintaining a knowledge sharing environment. Always ensuring a positive experience for everyone.   Leadership: He shares valuable insights on community growth, engagement, and future trends. Their contributions help shape the Power Platform Community.   Congratulations, Laurens Martens, for your outstanding work! Keep inspiring others and making a difference in the community!   Keep up the fantastic work!        

Check out the Copilot Studio Cookbook today!

We are excited to announce our new Copilot Cookbook Gallery in the Copilot Studio Community. We can't wait for you to share your expertise and your experience!    Join us for an amazing opportunity where you'll be one of the first to contribute to the Copilot Cookbook—your ultimate guide to mastering Microsoft Copilot. Whether you're seeking inspiration or grappling with a challenge while crafting apps, you probably already know that Copilot Cookbook is your reliable assistant, offering a wealth of tips and tricks at your fingertips--and we want you to add your expertise. What can you "cook" up?   Click this link to get started: https://aka.ms/CS_Copilot_Cookbook_Gallery   Don't miss out on this exclusive opportunity to be one of the first in the Community to share your app creation journey with Copilot. We'll be announcing a Cookbook Challenge very soon and want to make sure you one of the first "cooks" in the kitchen.   Don't miss your moment--start submitting in the Copilot Cookbook Gallery today!     Thank you,  Engagement Team

Announcing Power Apps Copilot Cookbook Gallery

We are excited to share that the all-new Copilot Cookbook Gallery for Power Apps is now available in the Power Apps Community, full of tips and tricks on how to best use Microsoft Copilot as you develop and create in Power Apps. The new Copilot Cookbook is your go-to resource when you need inspiration--or when you're stuck--and aren't sure how to best partner with Copilot while creating apps.   Whether you're looking for the best prompts or just want to know about responsible AI use, visit Copilot Cookbook for regular updates you can rely on--while also serving up some of your greatest tips and tricks for the Community. Check Out the new Copilot Cookbook for Power Apps today: Copilot Cookbook - Power Platform Community.  We can't wait to see what you "cook" up!    

Welcome to the Power Automate Community

You are now a part of a fast-growing vibrant group of peers and industry experts who are here to network, share knowledge, and even have a little fun.   Now that you are a member, you can enjoy the following resources:   Welcome to the Community   News & Announcements: The is your place to get all the latest news around community events and announcements. This is where we share with the community what is going on and how to participate.  Be sure to subscribe to this board and not miss an announcement.   Get Help with Power Automate Forums: If you're looking for support with any part of Power Automate, our forums are the place to go. From General Power Automate forums to Using Connectors, Building Flows and Using Flows.  You will find thousands of technical professionals, and Super Users with years of experience who are ready and eager to answer your questions. You now have the ability to post, reply and give "kudos" on the Power Automate community forums. Make sure you conduct a quick search before creating a new post because your question may have already been asked and answered. Galleries: The galleries are full of content and can assist you with information on creating a flow in our Webinars and Video Gallery, and the ability to share the flows you have created in the Power Automate Cookbook.  Stay connected with the Community Connections & How-To Videos from the Microsoft Community Team. Check out the awesome content being shared there today.   Power Automate Community Blog: Over the years, more than 700 Power Automate Community Blog articles have been written and published by our thriving community. Our community members have learned some excellent tips and have keen insights on the future of process automation. In the Power Automate Community Blog, you can read the latest Power Automate-related posts from our community blog authors around the world. Let us know if you'd like to become an author and contribute your own writing — everything Power Automate-related is welcome.   Community Support: Check out and learn more about Using the Community for tips & tricks. Let us know in the Community Feedback  board if you have any questions or comments about your community experience. Again, we are so excited to welcome you to the Microsoft Power Automate community family. Whether you are brand new to the world of process automation or you are a seasoned Power Automate veteran - our goal is to shape the community to be your 'go to' for support, networking, education, inspiration and encouragement as we enjoy this adventure together.     Power Automate Community Team

Hear what's next for the Power Up Program

Hear from Principal Program Manager, Dimpi Gandhi, to discover the latest enhancements to the Microsoft #PowerUpProgram, including a new accelerated video-based curriculum crafted with the expertise of Microsoft MVPs, Rory Neary and Charlie Phipps-Bennett. If you’d like to hear what’s coming next, click the link below to sign up today! https://aka.ms/PowerUp  

Tuesday Tip | How to Report Spam in Our Community

It's time for another TUESDAY TIPS, your weekly connection with the most insightful tips and tricks that empower both newcomers and veterans in the Power Platform Community! Every Tuesday, we bring you a curated selection of the finest advice, distilled from the resources and tools in the Community. Whether you’re a seasoned member or just getting started, Tuesday Tips are the perfect compass guiding you across the dynamic landscape of the Power Platform Community.   As our community family expands each week, we revisit our essential tools, tips, and tricks to ensure you’re well-versed in the community’s pulse. Keep an eye on the News & Announcements for your weekly Tuesday Tips—you never know what you may learn!   Today's Tip: How to Report Spam in Our Community We strive to maintain a professional and helpful community, and part of that effort involves keeping our platform free of spam. If you encounter a post that you believe is spam, please follow these steps to report it: Locate the Post: Find the post in question within the community.Kebab Menu: Click on the "Kebab" menu | 3 Dots, on the top right of the post.Report Inappropriate Content: Select "Report Inappropriate Content" from the menu.Submit Report: Fill out any necessary details on the form and submit your report.   Our community team will review the report and take appropriate action to ensure our community remains a valuable resource for everyone.   Thank you for helping us keep the community clean and useful!

Users online (4,378)