How do I customise table column widths?

A standard Confluence wiki table has auto adjusting column widths, i.e. the more text you have in a cell, the wider the column will get. But what if you want the table to fill the entire available width? Or you want all the columns to be the same width?

You can use the {table-plus} macro to add some extra functionality to a standard Confluence table, including the ability to choose the width of the table and columns. Read below for instructions.

Take a look at the Atlassian Confluence documentation on the table-plus macro for more detail about everything this macro can do.

What you see

Wiki Mark-up

1. A Standard Table

Column heading

 

Putting more text in a cell makes the column wider, and less text makes the column...

...thinner.

|| Column heading || ||
| Putting more text in a cell makes the column wider, and less text makes the column... | ...thinner. |


2. Adding the Table-Plus macro

This table is surrounded by the {table-plus} macro

The macro automatically makes some simple changes to the table

3. For example, notice that as you hover your cursor over the table each row is highlighted in yellow

b. And you can also click on a column heading to sort the rows

1.

c.

2.

a.

{table-plus}

|| This table is surrounded by the {table-plus} macro || The macro automatically makes some simple changes to the table ||
| 3. For example, notice that as you hover your cursor over the table each row is highlighted in yellow | b. And you can also click on a column heading to sort the rows |
| 1. | c. |
| 2. | a. |

{table-plus}

3. Adding column attribute parameters

This column is 33% wide

This column is also 33% wide

And so is this one

Now no matter how much or how little text is in each table cell...

...the column width...

...will remain the same.

{table-plus:width=100%|columnAttributes=style=width:33%, style=width:33%, style=width:33%}

|| This column is 33% wide || This column is also 33% wide || And so is this one ||
| Now no matter how much or how little text is in each table cell... | ...the column width... | ...will remain the same. |

{table-plus}

This column is 200 pixels wide

This column is also 200 pixels wide

This column is 100 pixels wide

And the total width of this...

...table is...

...500 pixels.

{table-plus:width=500px|columnAttributes=style=width:200px, style=width:200px, style=width:100px}

|| This column is 200 pixels wide || This column is also 200 pixels wide || This column is 100 pixels wide ||
| And the total width of this... | ...table is... | ...500 pixels. |

{table-plus}

Related Topics

How do I use macros?

How do I align text inside table cells?

Labels
  • None