This user macro creates a 2 x 2 table, with the headings defined as 'Parameter' and 'Description'. It will create a table that looks like this:
Parameter | Description |
---|---|
Note: As the macro is written, the user cannot amend the heading titles when using the macro on a Confluence page.
The information on this page does not apply to Confluence OnDemand.
Defining the 'Formatted Table' user macro
- Choose the cog icon
at top right of the screen, then choose Confluence Admin.
- Choose User Macros in the left-hand panel.
- Choose Create a User Macro at the bottom of the list of macros.
- Enter the macro attributes as follows:
- Macro Name:
formtable
- Visibility:
Visible to all users in the Macro Browser
- Macro Title:
Formatted Table
Description:
Creates a simple 2 x 2 table with the column headings filled in
- Categories:
Formatting
- Icon URL: You can leave this field empty.
- Documentation URL: You can leave this field empty.
- Macro Body Processing:
Escaped
Template:
## @param Head1:type=string|desc=Heading ## @param Head2:type=string|desc=Heading ## @param Cell1:type=string|desc=cell ## @param Cell2:type=string|desc=cell #set ($paramHead1 ="Parameter") #set ($paramHead2 ="Description") <div id="preformattedtable"> <table> <tr> <th>$paramHead1</th> <th>$paramHead2</th> </tr> <tr> <td>$!paramCell1</td> <td>$!paramCell2</td> </tr> </table> </div>
- Macro Name:
- Choose Save.
Using the macro on a Confluence page
To add the macro to a page:
- In the Confluence editor, choose Insert > Other Macros.
Find and select the 'Formatted Table' macro.
- Enter the cell contents into the form.
- Choose Insert.
Amending the contents of the table
To change the content in the cells of the table:
- Edit the page.
- Click the macro placeholder for the 'Formatted Table' macro, to see the properties panel.
- Choose Edit.
- Enter the cell contents into the form.
- Choose Save
Note: Content entered into the body of the 'Formatted Table' macro will not appear on the page.