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 votes
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
Community showcase
Posted Oct 24, 2018 in Confluence

Atlassian Research opportunity with Confluence templates

Do you use templates with Confluence? Take part in a remote 1-hr workshop. You'll receive USD $100 for your time!   We're looking for people to participate in a   remote 1-hr workshop...

993 views 14 12
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