Skip to main content

Notifications

Community site session details

Community site session details

Session Id : LAgO/vxMlXOcspyBeMVC67
Power Apps - Building Power Apps
Answered

Two Columns HTML Text PowerApps

Like (0) ShareShare
ReportReport
Posted on 10 Apr 2023 01:22:36 by 14

Hi everyone! Is it possible to create two columns HTML text in PowerApps? Below is the exported PDF version of my HTML text. MY HTML text is dynamic. I tried using <div style='column-count: 2'> but doesn't seem to work. Thank you.

 

kess_0-1681089515082.png

 

Here is my current HTML text code:

"<html>
<body>
<p style = 'font-family:courier new'>USD Serial List
<br>Generated By: " & ProfileName &
"<br>Date / Time: " & Now() & 

"<div style = 'column-count: 2'>
<table style = 'font-family:courier new'>
<thead><tr><th>Denomination</th><th>Serial</th></thead>
<tbody style = 'text-align:center;'>" 
& Concat(billCollection, "<tr><td>" & Substitute(NumeralDenomination,"USD ","") & "</td><td>" & SerialNumber & "</td></tr>") &
"</tbody></table><br>

<table style='font-family:courier new;'>
<thead><tr><th>Denomination</th><th>Count</th><th>Total</th></tr></thead>
<tbody style = 'text-align:center;'>" 
& Concat(billDenominationCountUser, "<tr><td>" & Substitute(Title,"USD ","") & "</td><td>" & billCountUser & "</td><td>" & Substitute(Title,"USD ","")*billCountUser & "</td></tr>") &
"</tbody></table>

<h4 style = font-family:courier new;>--------------------------<br>GRAND TOTAL: " & Concatenate("USD ", Sum(billCollection,Substitute(NumeralDenomination,"USD ",""))) &
"</h4> <br>
<p>----------------------------------------------</p>
<p style = font-family:courier new; >Client's Conforme</p>
</div>
</body>
</html>"

 

  • SolTeferi Profile Picture
    on 21 Apr 2023 at 05:18:01
    Re: Two Columns HTML Text PowerApps

    The solution above works well. But, there is a little bug that repeats a row at the  bottom a table split and at the top of the next split. So, to fix that, please, use the following updated formula, which perfectly aligns the splits side by side:

    With(
     {
     wraps: RoundUp(
     CountRows(billCollection) / 2,
     0
     )
     },
     With(
     {
     colCount: RoundUp(
     CountRows(billCollection) / wraps,
     0
     )
     },
     With(
     {
     colSerial: Sequence(
     colCount,
     1,
     1
     )
     },
     "<html>
    <body>
    <p style = 'font-family:courier new'>USD Serial List
    <br>Generated By: " & ProfileName & "<br>Date / Time: " & Now() & Concat(
     ForAll(
     colSerial,
     With(
     {seq: ThisRecord.Value},
     With(
     {
     counted: LastN(
     FirstN(
     billCollection,
     seq * wraps
     ),
     If(
     seq = CountRows(colSerial),
     CountRows(billCollection) - (seq - 1)*wraps,
     wraps
     )
     )
     },
     "<div style='position:relative; float:left'>
    <table style = 'font-family:courier new; page-break-inside:auto'>
    <thead><tr 
     
    ><th>Denomination</th><th>Serial</th></thead>
    <tbody style = 'text-align:center;'>" & Concat(
     counted,
     "<tr ><td>" & Substitute(
     NumeralDenomination,
     "USD ",
     ""
     ) & "</td><td>" & SerialNumber & "</td></tr>"
     ) & "</tbody></table></div>"
     )
     )
     ),
     Value
     )
     )
     )
    )
  • Verified answer
    SolTeferi Profile Picture
    on 11 Apr 2023 at 06:58:25
    Re: Two Columns HTML Text PowerApps

    Hi @kess ,

     

    With a little bit of HTML tricks, you can achieve the number of wraps you want the table to split into. Please try the following. Currently, it splits the table into two side by side. If you want to split it into, for example, three, just change the '2' in 'CountRows(billCollection)/2' to '3'.

     

     

    With(
     {wraps: CountRows(billCollection) / 2},
     With(
     {
     colCount: RoundUp(
     CountRows(billCollection) / wraps,
     0
     )
     },
     With(
     {
     colSerial: Sequence(
     colCount,
     1,
     1
     )
     },
     "<html>
    <body>
    <p style = 'font-family:courier new'>USD Serial List
    <br>Generated By: " & ProfileName & "<br>Date / Time: " & Now() & Concat(
     ForAll(
     colSerial,
     With(
     {
     counted: LastN(
     FirstN(
     billCollection,
     ThisRecord.Value * wraps
     ),
     wraps
     )
     },
     "<div style='position:relative; float:left'>
    <table style = 'font-family:courier new; page-break-inside:auto'>
    <thead><tr 
     
    ><th>Denomination</th><th>Serial</th></thead>
    
    <tbody style = 'text-align:center;'>" & Concat(
     counted,
     "<tr ><td>" & Substitute(
     NumeralDenomination,
     "USD ",
     ""
     ) & "</td><td>" & SerialNumber & "</td></tr>"
     ) & "</tbody></table></div>"
     )
     ),
     Value
     )
     )
     )
    )

     

     

  • v-jefferni Profile Picture
    on 11 Apr 2023 at 05:35:34
    Re: Two Columns HTML Text PowerApps

    Hi @kess ,

     

    Sorry, but I have to say it's not possible in PowerApps.

     

    Best regards,

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,710 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,030 Most Valuable Professional

Leaderboard