How to set jira table's column width

Solution was to set the table headers names with noformat. If you need a wider table, just add some spaces to the header and wrap it in noformat. And jira will keep the column width basing on that preformatted header.

So example would be:

||{noformat}Header1  {noformat}||Header2||{noformat} Header3          {noformat}||Header4||
|data1|data2|data3|data4|
....

In this example the width of columns with header2 and header4 will be generated dynamically depending on which's content is longer (the column width could be even set dynamically to 1 symbol). While width of header1 and header3 will never be smaller then the length of the column name.

This solution does not allow to set the width of the column, but at least it allows to make some columns to be wide enough to show data correctly.


Since noformat does not look very pretty, i got anonther solution here, which probably is the prettiest one (when you look at the result and not the markup):

I just created a transparent image with a size of 1x1px and inserted it in the column headers with the minimum size I wanted the columns to be. In order to make the header text vertically centered, I needed to insert it before and after the text. See the following example:

|| !transparent.png|width=300px, height=1px! Col1 !transparent.png|width=300px, height=1px! || Col2 || Col3 ||
|| Row header | Content of column 1 | Content of column 2 |

A lot of HTML non-breaking line spaces.. i.e.

 

so a header will contain code like this..

||                       Field Description          ||Reserved Field||

It's a bit icky but it works in shifting the centre and expanding the column width. sadly this is limited to other content too but a lot prettier than {noformat}. Doesn't allow fixed sizing but better than squashed columns

e.g.

Formatted table with better column width

Tags:

Jira