cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MK18
Helper I
Helper I

html table formatting to team

Hi, 

 

I am wondering how I can represent table in a better look in Teams

 

Below is what I received in the Teams. I would like to have table lines and colours in background. 

MK18_0-1651328002241.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
Heartholme
Super User
Super User

@MK18 

 

After a lot of back and fourth I can't get this to work. I could not find any official documentation of this but my conclusion is that teams is running HTML5 (where the command: bgcolor = "red" for example is discontinued, reference: https://www.geeksforgeeks.org/html-bgcolor-attribute/)

 

Heartholme_0-1651345086054.png

 

And that teams right now, does not support CSS styling (Refrence on this: https://techcommunity.microsoft.com/t5/teams-developer/styling-html-message-from-graph-in-teams/m-p/...)

 

So when teams are running HTML5 which dosen't support "bgcolor" and in addition dosen't support CSS styling, it's as far as I can see impossible to add background color to your tables in teams. You can add a border (see below), and you should be able to change the text color of your text.

 

To add a border <table border = "2"> in the start of the HTML script.

 

Hope this was helpful.

View solution in original post

4 REPLIES 4
Heartholme
Super User
Super User

Hi MK18,

 

This should help you out; 

 

Keep your CSS script in a compose action:

Heartholme_0-1651329463699.png

 

Then add the output of the compose before your HTML table like this:

 

Heartholme_3-1651329642623.png

 

 

Output:

 

Heartholme_2-1651329586488.png

 

If this solved your case, please mark it as a solution.

 

Let me know if you have any further issues.

 

Br

Heartholme

 

Additional information:

 

CSS script:

<style>

table{
font-family: Arial, Helvetica, sans-serif;
background-color: #EEEEEE;
border-collapse:collapse;
width: 100%;
}

Table td, table th {
border: 1px solid #ddd;
padding: 3px 3px;
}

 

HTML table in compose:

 

<table>
<tbody>
<tr>
<td>Equipment ID </td>
<td>&nbsp;Numberlocation</td>
<td>Eqiument name</td>
<td>Due date</td>
</tr>
<tr>
<td>&nbsp;Q0003</td>
<td>QA</td>
<td>Chroma Meter</td>
<td>empty</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>

 

 

MK18
Helper I
Helper I

HI @Heartholme 

 

I did like below

 

MK18_8-1651332603727.png

 

MK18_2-1651332266564.png

 

Do I need to do anything with below you posted??

 

 

HTML table in compose:

 

<table>
<tbody>
<tr>
<td>Equipment ID </td>
<td>&nbsp;Numberlocation</td>
<td>Eqiument name</td>
<td>Due date</td>
</tr>
<tr>
<td>&nbsp;Q0003</td>
<td>QA</td>
<td>Chroma Meter</td>
<td>empty</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>

 

MK18_3-1651332305519.png

 

but still showing like before

 

 

 

Heartholme
Super User
Super User

 Sorry for the late reply. I checked the code in teams right after I posted and saw that it didn't run as intended, but had to run out for an errand.

 

Seems like teams dosen't support CSS formatting. So we have to do all the formatting inside the HTML.

 

If you ditch the CSS script and add a border like this it should work:

 

<table border = "2">
<tr>
<td>Equipment ID </td>
<td>&nbsp;Numberlocation</td>
<td>Eqiument name</td>
<td>Due date</td>
</tr>
<tr>
<td>&nbsp;Q0003</td>
<td>QA</td>
<td>Chroma Meter</td>
<td>empty</td>
</tr>
</tbody>
</table>

 

I didn't work out the background color but I will check some more and get back to you.

 

 

Heartholme
Super User
Super User

@MK18 

 

After a lot of back and fourth I can't get this to work. I could not find any official documentation of this but my conclusion is that teams is running HTML5 (where the command: bgcolor = "red" for example is discontinued, reference: https://www.geeksforgeeks.org/html-bgcolor-attribute/)

 

Heartholme_0-1651345086054.png

 

And that teams right now, does not support CSS styling (Refrence on this: https://techcommunity.microsoft.com/t5/teams-developer/styling-html-message-from-graph-in-teams/m-p/...)

 

So when teams are running HTML5 which dosen't support "bgcolor" and in addition dosen't support CSS styling, it's as far as I can see impossible to add background color to your tables in teams. You can add a border (see below), and you should be able to change the text color of your text.

 

To add a border <table border = "2"> in the start of the HTML script.

 

Hope this was helpful.

Helpful resources

Announcements
 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (5,145)