cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
misc
Resolver III
Resolver III

HTML table formatting squished - need fixed column widths

I have a flow which takes the most recently updated/created line of a sharepoint list and emails the data in a table to the person who created that record. The flow looks like this:

flow1.png

There is a lot of data in this list (100 columns, exactly).

flow2.png

I added in the 'Compose' action to format the table and used CSS from here but when the flow triggers the outcome looks like the below:

flow4.png

Clearly, this is not a useable report! I want to be able to fix the width of the columns so it doesn't squish the output and the user can just scroll along to read the full line. Is there any way this can be done? I have tried changing the 100% to px but this didn't change anything. Screenshot of the CSS below:

flow3.png

Is it just that there's a limit to how wide an email can be?

 

If so, are there any suggestions for another flow which allows me to pick out one line of data from a Sharepoint list and emails this data to the person who created it in an easy to read format?

 

Thanks,

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @misc 

 

It's simply too many columns. The email client will interpret them as it can, but I don't think, even if we try to fine-tune the HTML, we'll get what you need.

 

Try an attached Excel. It's simple, and it's better for everyone in case someone wants to do some operations on the data.

 

Think about it and please let me know if you have any questions, ok?

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Cheers
Manuel

View solution in original post

7 REPLIES 7
manuelstgomes
Super User
Super User

HI @misc 

 

That's a lot of columns 😀.

 

Try adding padding in each of the columns to see if you can get something useful:

replace(outputs(‘FormatTable’),'<td>’,'<td style=”padding:20px”>’)

 

Can you please check if and let me know if you have any questions?

 

Also, can't you generate a nice PDF or Excel file with all of this information and attach it in the email. Do you really need to send it in the body?

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Cheers
Manuel

 

Thanks for your response. I tried changing wherever the CSS said 'padding' to 20px 20px and the output was slightly different & consistent but still not right:

 

fewwe.png

(I've actually managed to cut down on some columns too by merging some together.)

 

Unless I was misunderstanding where you were saying to edit? I'm pretty new to this so sorry if I've misunderstood.



<style>
table {
  font-family: Arial, Helvetica, sans-serif;
  border: 1px solid #1C6EA4;
  background-color: #EEEEEE;
width: 100%;
text-align: left;
  border-collapse: collapse;
}
table td, table th {
  border: 1px solid #AAAAAA;
  padding: 20px 20px;
}
table tbody td {
  font-size: 13px;
}
table tr:nth-child(even) {
  background: #D0E4F5;
}
table thead {
  background: #1C6EA4;
  background: -moz-linear-gradient(top, #5592bb 0%, #327cad 66%, #1C6EA4 100%);
  background: -webkit-linear-gradient(top, #5592bb 0%, #327cad 66%, #1C6EA4 100%);
  background: linear-gradient(to bottom, #5592bb 0%, #327cad 66%, #1C6EA4 100%);
  border-bottom: 2px solid #444444;
}
table thead th {
  font-size: 15px;
  font-weight: bold;
  color: #FFFFFF;
  border-left: 2px solid #D0E4F5;
}
table thead th:first-child {
  border-left: none;
}
table tfoot {
  font-size: 14px;
  font-weight: bold;
  color: #FFFFFF;
  background: #D0E4F5;
  background: -moz-linear-gradient(top, #dcebf7 0%, #d4e6f6 66%, #D0E4F5 100%);
  background: -webkit-linear-gradient(top, #dcebf7 0%, #d4e6f6 66%, #D0E4F5 100%);
  background: linear-gradient(to bottom, #dcebf7 0%, #d4e6f6 66%, #D0E4F5 100%);
  border-top: 2px solid #444444;
}
table tfoot td {
  font-size: 14px;
}
table tfoot .links {
  text-align: right;
}
table tfoot .links a{
  display: inline-block;
  background: #1C6EA4;
  color: #FFFFFF;
  padding: 20px 20px;
  border-radius: 5px;
}
</style>

 

There seems to also be an error with the final column which has multiple column's data in it (and the formatting goes weird too - hence the black font rather than white). Not too sure what's up there either.

 

I wanted it embedded in the body for ease of reference but I'm starting to think you're right and it might be easier to just attach an excel file to the email instead if I can't get this working.

Hi @misc 

 

It's simply too many columns. The email client will interpret them as it can, but I don't think, even if we try to fine-tune the HTML, we'll get what you need.

 

Try an attached Excel. It's simple, and it's better for everyone in case someone wants to do some operations on the data.

 

Think about it and please let me know if you have any questions, ok?

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Cheers
Manuel

That's fair enough - thanks for your help!

Hi Manuel, sorry to come back to this. do you have a recommended flow for creating an excel file when a sharepoint record is created or modified and attaching it to an email? 

Hi @misc 

 

No worries.

 

Here's a skeleton to help you achieve this. You start with the trigger, add the line to excel, get the details of the file, and then send it as an attachment.

Screenshot 2020-08-17 at 12.28.54.png

 

Can you please check if and let me know if you have any questions?

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Cheers
Manuel

mjfox52610
Frequent Visitor

Too many columns.  I ran into this with mine so I create multiple tables within my email and grouped the columns according to how I wanted the tables to look.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Users online (2,990)