cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
aaronhowe
Frequent Visitor

HTML to PDF: Aligning row content across columns

I have managed to get some gallery-fed data into a HTML table ready for output to PDF, and with some trial and error fixed the left-side-clipping issue.

 

However in getting the data into the HTML format I had to use Concat and <br> tags to get the data out of a single string and into separate row items.  Where the text doesn't spill over that's fine, but where it does the data in subsequent columns doesn't adjust position to match... which I guess it couldn't as it doesn't technically behave like many rows, but rather like one row:

aaronhowe_0-1655999623363.png

 

And the code:

<table style=""width: auto;"">
	<tbody>
		<tr>
			<th style=""width: 80%; text-align: left;"">Fee Summary
				<br>Based on " & SumHours & " hours total
			</th>
			<th style=""width: 10%; text-align: left;"">Frequency
            </th>
			<th style=""width: 10%; text-align: right;"">Fee
			</th>
		</tr>
		<tr>
			<td style=""text-align: left;"">" & Concat(
				Gallery_SummaryDetail.AllItems,
				Label_TaskDetail.Text,
				"<br>"
				) & "
			</td>
			<td style=""text-align: left;"">" & Concat(
				TempQuoteBuilder,
				Frequency,
				"<br>"
				) & "
			</td>
			<td style=""text-align: right;"">" & Concat(
				TempQuoteBuilder,
				Text(
				Value(DiscountedTotal),
				"£#,###"
				),
				"<br>"
				) & "
			</td>
		</tr>
	</tbody>
</table>

 

So I have a couple of questions:

1. Have I used the right function to display multiple items in a table, or is there a more sensible method where the number of items can vary, and

2. Is there therefore any way to link the other two fields (Frequency and Fee) to the main items yet still have them format correctly across the space, if they do all have to be displayed as single records?

 

Thanks in advance for any and all advice.

1 ACCEPTED SOLUTION

Accepted Solutions
v-bofeng-msft
Community Support
Community Support

Hi  @aaronhowe ,

 

Please try:

"<table style=""width: auto;"">
    <tbody>
        <tr>
            <th style=""width: 80%; text-align: left;"">Fee Summary
                <br>Based on " & SumHours & " hours total
            </th>
            <th style=""width: 10%; text-align: left;"">Frequency
            </th>
            <th style=""width: 10%; text-align: right;"">Fee
            </th>
        </tr>"&
Concat(ForAll(
  Gallery_SummaryDetail.AllItems,
  "<tr><td style=""text-align: left;"">"  & 
  Label_TaskDetail.Text                   &  
  "</td><td style=""text-align: left;"">" &
  Frequency                               &
  "</td><td style=""text-align: left;"">" &
  Text(Value(DiscountedTotal),"£#,###")   &
  "</td></tr>"
),Value)

&
    "</tbody>
</table>"

 

Best Regards,

Bof

View solution in original post

2 REPLIES 2
v-bofeng-msft
Community Support
Community Support

Hi  @aaronhowe ,

 

Please try:

"<table style=""width: auto;"">
    <tbody>
        <tr>
            <th style=""width: 80%; text-align: left;"">Fee Summary
                <br>Based on " & SumHours & " hours total
            </th>
            <th style=""width: 10%; text-align: left;"">Frequency
            </th>
            <th style=""width: 10%; text-align: right;"">Fee
            </th>
        </tr>"&
Concat(ForAll(
  Gallery_SummaryDetail.AllItems,
  "<tr><td style=""text-align: left;"">"  & 
  Label_TaskDetail.Text                   &  
  "</td><td style=""text-align: left;"">" &
  Frequency                               &
  "</td><td style=""text-align: left;"">" &
  Text(Value(DiscountedTotal),"£#,###")   &
  "</td></tr>"
),Value)

&
    "</tbody>
</table>"

 

Best Regards,

Bof

Thank you so much, @v-bofeng-msft.  That worked perfectly.

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

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.

Users online (3,363)