cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Charles-v-D
Level: Powered On

Adding borders to a table

Hi All,

 

I'm using the "Create HTML table" action, which is being populated with data from an Array. The HTML table is then dropped into a "Send an Email ((v2)" action. The content of the both the e-mail and table is fine.... BUT: the table itself is not shown. I see my text in virtual columns, but I would love to see the borders of each cell in the table... as this make reading the lines easier etc....

 

Is there a way to get this done?

 

Thanks

Regards

Charles

 

1 ACCEPTED SOLUTION

Accepted Solutions
Dual Super User
Dual Super User

Re: Adding borders to a table

Hi @Charles-v-D 

 

Yes. You can refer to the screenshot below for the same: 

dd.PNG

Code: 

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

td, th {
  border: 1px solid #dddddd;
  text-align: left;
  padding: 8px;
}

tr:nth-child(even) {
  background-color: #dddddd;
}
</style>
</head>

Output: 

d4.PNG

 

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

6 REPLIES 6
Super User
Super User

Re: Adding borders to a table

Hi @Charles-v-D 

It's fairly simple, you can use the replace function to change the HTML string generated by the 'Create HTML Table' action:

1.png

Expression: replace(body('Create_HTML_table'),'<table>','<table border="1">')

Example output:

4.pngHTH

Jay

-------------------------------------------------------------------------

If I have answered your question, please mark your post as Solved.

If you like my response, please give it a Thumbs Up

Dual Super User
Dual Super User

Re: Adding borders to a table

Hi @Charles-v-D 

 

Yes. You can refer to the screenshot below for the same: 

dd.PNG

Code: 

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

td, th {
  border: 1px solid #dddddd;
  text-align: left;
  padding: 8px;
}

tr:nth-child(even) {
  background-color: #dddddd;
}
</style>
</head>

Output: 

d4.PNG

 

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

Charles-v-D
Level: Powered On

Re: Adding borders to a table

Hi @yashag2255 

 

Thanks for the quick turnaround! I have made an e-mail action exactly like yours but I simply get the whole code as plain text in the e-mail with the border-less table at the end... what am I doing wrong?

 

Regards

Charles

 

Dual Super User
Dual Super User

Re: Adding borders to a table

Hi @Charles-v-D 

 

Can you share a screenshot of your email action? On that can you check what action you are using and if you have enabled the code editor on the action? 

 

de3.PNG

 

Click the icon to enter code mode. 

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Charles-v-D
Level: Powered On

Re: Adding borders to a table

@Jay-Encodian  thanks for your help on this. I was able to solve the problem using @yashag2255 approach already... thanks anyway!

Charles-v-D
Level: Powered On

Re: Adding borders to a table

@yashag2255 the suggestion to put it into code mode solved it! Thanks!!

 

Additionally. Can you provide coding example on how to set the letter-type and letter-size to Calibri 10 ??

 

Thanks

 

Regards

Charles

 

 

Helpful resources

Announcements
firstImage

New Ranks and Rank Icons in April

Read the announcement for more information!

firstImage

Better Together Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (9,087)