It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

how to place HTML table code in confluence page?

I am having issue in displaying HTML table in confluence. Table works fine in browser but not in confluence. is there any specific plugin/macro which needs to enabled? please help me with this. 

1 answer

1 accepted

1 vote
Answer accepted
DPK_J Community Leader Aug 22, 2019

You need to do this inside HTML macro, in newer version of confluence this macro needs to be enabled from Admin screen.

Hi,

Thank you for your kind response.

I have code inside HTML macro. Version of confluence is  6.13.4.  Table is displaying in browser but not in confluence. Please help me with the solution..

DPK_J Community Leader Aug 22, 2019

Have you sanitized markup for table?

Can you share small snippet of editor from confluence where you are adding table html code.

Capture.PNGOkay, i have this HTML code for table which i directly written in HTML macro of confluence. In browser it's showing proper colored,bordered table but in confluence it's not showing any table, 

DPK_J Community Leader Aug 22, 2019

@Kirti sabade

There are few points here,

  • HTML macro is not meant for creating new html page inside existing HTML page of confluence.
  • If want to style table differently, start with <table> tag, and use inline styling for its elements.
  • If you still want to create full <html> then try wrapping it in <iframe>.

Like this for inline styling,

<table>

<tr><th style="color: #FF0000;">Head</th></tr>

<tr><tr style="color: #00FF00;">Row</tr></tr>

</table>

 

And like this for <iframe> wrapping

<iframe>

<!DOCTYPE html>

<html>

<head>

<style>

table th {

color: #FF0000;

}

table tr {

color: #00FF00;

}

</style>

</head>

<body>

<table style="width:100%">

<tr> <th>Head</th> </tr>

<tr> <td>Row</td> </tr>

</table>

</body>

</html>

</iframe>

Okay, I have this 400 line table code. Now please tell me where should i place this entire code if i want this to appear in confluence, exact same as way as it appears in my web browser. 

And thank you so much for bearing with me. much appreciated sir :) 

DPK_J Community Leader Aug 22, 2019

I would suggest use inline styling, and start content directly from <table> tag.

C.PNG 

When i paste your sample code in <iframe> this what i get.

DPK_J Community Leader Aug 22, 2019

Better use inline styling. Try that also.

Iframe uses changes in confluence from version to version.

iframe.PNG

SO in inline style, should i paste entire html code or just from <table> tag? if only <table> then where will i paste <html> and <iframe>? what will be in the URL section?

 

Thanks,

DPK_J Community Leader Aug 23, 2019

No, you need to use HTML macro only.

And put html code like this in it.

<table>

<tr style="border: 2px solid #333; backgroud-color: #efefef; color: #999;" ></tr>

</table>

Here

style="border: 2px solid #333; backgroud-color: #efefef; color: #999;"

is inline style for table's tr element.

Like Kirti sabade likes this

Its looking like this,

cc.PNG

Table should rather look like this,tt.PNG

Whats the ideal way to implement this,

DPK_J Community Leader Aug 23, 2019

So I have tried is my self, I have added this code to HTML macro

Screenshot 2019-08-23 at 1.43.53 PM.png

 

Which produces this output

Screenshot 2019-08-23 at 1.44.06 PM.png

Like Kirti sabade likes this

How come it's not working with me.. is it because i need to place images and text strings inside the table rows and columns?

 

okay here is my mail-id sabadekirti95@gmail.com please send hi, i will share the code snippet with you. here i could't able to share large code. would you be fine with that? otherwise also its fine.

Here is how my code looks. there are tiny images on every row and column.

a.PNG

Never mind, Guess what?? It worked!! Thank you so much sir! I owe you so much..

 

Thank you so much for your patience and help! great day ahead!

Like Deepanshu_Natani likes this

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Posted in Confluence

How is your team having fun and bonding, remotely, utilizing Confluence?

Thanks everyone for answering last week’s question. The winner of the random drawing from those who commented is: @LarryBrock I’ll contact you separately with your prize details. This wee...

306 views 9 7
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you