'How does Confluence markup table formatting work?

I'm building a tool that will create a formatted page of data that I can paste into confluence. The issue I'm having is with tables. According to the help pages I should be able to use the following markup to create a table, but when I paste it in it stays as-is.

|| Col1 || Col2 || Col3 ||
|---|---|---|
|Value1|Value2|Value3|
|Value4|Value5|Value6|

If I hit return on any of the rows, only that row gets turned into a table, and hitting return on subsequent rows doesn't add the rows to the same table. I can't hit return on all the rows anyway so this isn't a viable solution. I've also tried using the macro to insert it, but then it turns all rows into a single row. What am I missing?

As an FYI, I am resisting building this out as a full html page as I want to use the built-in TOC functionality and not sure how that will go plus as far as I can tell the markdown doesn't support it



Solution 1:[1]

Seems it's the markdown that is the issue - if you select "Confluence wiki" from the dropdown when using the markup macro it works

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 CarllDev