How to prevent Confluence 4.x from inserting paragraphs around table elements inserted via wiki markup

  1. Edit a page and select Insert -> Wiki Markup
  2. Add table markup like
    || AA || 
    | bb |
  3. Results in a table that when viewed as source looks like:
    <table class="confluenceTable"><tbody><tr><th class="confluenceTh"><p>AA</p></th></tr><tr><td class="confluenceTd"><p>bb</p></td></tr></tbody></table>
  4. This is different than Confluence 3.x and different that what is produced using native table insert

Another question is how to you edit the page to remove the extra <p> that are inserted?

This seems like a bug.

3 answers

This widget could not be displayed.
David Simpson Community Champion Sep 16, 2012

You could try doing it client-side :)

Something like this:

AJS.$('.confluenceTh &gt; p,.confluenceTd &gt; p').children().unwrap();

David Simpson Community Champion Sep 16, 2012

Sorry, I didn't quite get what you meant by native table insert. Likely that won't work :(

Thanks, I just mean using insert table natively in the confluence editor.

Hi,

i am also facing the same problem i have few user macros i want to fetch the contents between thoes where the </p> tags get added its not unexpected.

This widget could not be displayed.

This is a kludge. It doesn't prevent Confluence from adding the <p>s, but it does prevent them from showing on your pages:

If you already have a stylesheet you use add to it:

.noP p {
  display:none;
}

If you don't have a stylesheet, add the following at the top of each page where you have the issue:

{style}
  .noP p {
   display:none;
}
{style}

Then wrap your tables with a div of class noP like so,

{div:class=noP}
{table}
…
{table}
{div}
This widget could not be displayed.

Could someone from Atlassian comment on this behavior?

Suggest an answer

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

Why start from scratch? Introducing four new templates for Confluence Cloud

Hi my Community friends!  For those who don't know me, I'm a product marketer on the Confluence Cloud team - nice to meet you! For those of you who do, you know that I've been all up in your Co...

264 views 2 4
Join discussion

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you