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

0 vote
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 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}

Could someone from Atlassian comment on this behavior?

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jul 10, 2018 in Confluence

We want to see the templates you've created in Confluence!

Hi Community, Jessica here from the Confluence Product Marketing team!  July’s community challenge is all about sharing pictures  — and as an extension of our first post on what ...

975 views 23 13
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