web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / HTML Colspan in HTML T...
Power Apps
Answered

HTML Colspan in HTML Text/Email Body

(0) ShareShare
ReportReport
Posted on by 224

Can anyone point me in the right direction in regards to updating my below code with an IF statement on the Start Date cell?

 

Essentially I want to check IF Start Date = End Date, then merge the cells (<td colspan='2'>), else, leave the cells as is. Below is an example of how the cells should be merged for same Date vs 2 different dates.

 

I'm having an issue putting together the If statement and the html formatting.

 

as733y_0-1707239479721.png

 

"<style> th { font-weight: bold; font-size: 20px; background-color: #00A8E0; } td { font-weight: normal; font-size: 18px; }</style>

<table border=1 style=text-align:center; width:100%;>
<tr>
<th>Approved?</th>
<th>Requester</th>
<th>Start Date</th>
<th>End Date</th>
<th>Notes</th></tr>" & Concat(Gallery1.AllItems,$"<tr>

<td style=text-align:center; width:100%>{If(ThisRecord.Checkbox1.Value=true," APPROVED","")}
<td style=text-align:center; width:100%>{ThisRecord.'aCreated By'.DisplayName}
<td style=text-align:center; width:100%>{ThisRecord.'Start Date'}

</td></tr>")&"</table>"

 

Categories:
I have the same question (0)
  • Verified answer
    TheRobRush Profile Picture
    11,128 Moderator on at

    Place this in a HTML control, should help you figure out your own syntax

    "<style> th { font-weight: bold; font-size: 20px; background-color: #00A8E0; } td { font-weight: normal; font-size: 18px; }</style>
    
    <table border=1 style=text-align:center; width:100%;>
    <tr>
    <th>Approved?</th>
    <th>Requester</th>
    <th>Start Date</th>
    <th>End Date</th>
    <th>Notes</th></tr><tr>"
    &
    Concat(
    ForAll(Sequence(2) As exampleRows, 
    Switch(exampleRows.Value,1,
    "<td style=text-align:center; width:100%>{1}
    <td style=text-align:center; width:100%>{1}
    <td style=text-align:center; width:100%>{1}
    <td style=text-align:center; width:100%>{1}
    <td style=text-align:center; width:100%>{1}</td></tr>",
    "<td style=text-align:center; width:100%>{1}
    <td style=text-align:center; width:100%>{1}
    <td style=text-align:center; width:100% colspan='2'>{22}
    <td style=text-align:center; width:100%>{1}</td></tr>")),Value)&
    "</table>"

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 493 Most Valuable Professional

#2
11manish Profile Picture

11manish 479

#3
Haque Profile Picture

Haque 328

Last 30 days Overall leaderboard