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

Notifications

Announcements

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard