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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 404

#2
timl Profile Picture

timl 344 Super User 2026 Season 1

#3
WarrenBelz Profile Picture

WarrenBelz 320 Most Valuable Professional

Last 30 days Overall leaderboard