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 Automate / HTML table styling for...
Power Automate
Unanswered

HTML table styling for multiple tables - only latest CSS is applied, earlier CSS is overwritten

(0) ShareShare
ReportReport
Posted on by 14

I'm trying to style 2 HTML tables differently but nothing I've tried is working. Here's a screenshot of my super basic testing flow:

kstiegler_1-1662749469842.png

 

And here is the entire contents of the "Create 2 HTML tables styled differently" step:

 

<style>
#services table, th, td {
 border: 1px solid black;
 border-collapse: collapse;
}

#signature table, th, td {
 border: 1px solid red;
 border-collapse: collapse;
}
</style>
<div id="services" class="output">
	<table>
		<thead>
			<tr>
				<th>table header</th>
			</tr>
		</thead>
		<tbody>
			<tr>
				<td>table contents</td>
			</tr>
		</tbody>
	</table>
</div>
<br>
<div id="signature" class="output">
	<table>
		<thead>
			<tr>
				<th>table header</th>
			</tr>
		</thead>
		<tbody>
			<tr>
				<td>table contents</td>
			</tr>
		</tbody>
	</table>
</div>

 

 

I found this post on the topic, but it doesn't matter if I try "#services" or ".services", the CSS applied to both tables is only the second CSS code (the "#signature" section above):

kstiegler_2-1662749611664.png

Has anyone managed to do this successfully in the last 4 years since that other post?

Categories:
I have the same question (0)
  • Verified answer
    David- Profile Picture
    1,254 on at

    I am almost positive that what is happening is that the e-mail is stripping out the class information, which is why only one set of CSS ends up being used. Based on your screen shot of the output, this seems to be the case since your red borders are in your second class.

     

    Coding HTML e-mail is still in the dark ages and works best with in-line styles and tables. This is a good post for tips on formatting HTML e-mails: Guide to HTML Email: Coding Templates From Scratch | Campaign Monitor. The last company I worked for we sent out e-mail campaigns, and it is truly an art to get this right so it displays correctly in all e-mail clients.

  • kstiegler Profile Picture
    14 on at

    THANK YOU! Using the CSS Inliner tool linked in your linked guide, I've managed to at least make my test flow format the two tables differently:

    kstiegler_0-1662756594871.png

    It'll take some work to duplicate that success in my production flow, but I know what needs to be done now. Thanks again!

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 Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard