30

I struggled with this question for some time and was able to find the solution. The idea is that my script automatically generates a data, puts it into table and there are some columns that should preserve their width (should not be less then something). But jira markup sets table column width dynamically basing on screen resolution and data that is preserved in all the table columns. And noformat for data cells did not help me because there was some symbols in those columns that required jira markup. I am not jira admin so using advanced plugins and jira scripts is not an option.

1
  • If you land here and need this, please login to Jira and add your comment to jira.atlassian.com/browse/JRASERVER-6034 and maybe they'll add a feature. Commented Mar 25, 2020 at 17:52

9 Answers 9

27

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.

Sign up to request clarification or add additional context in comments.

3 Comments

Doesn't work for me. Puts the header text into additional panel with scroll and leaves the column narrow (although wider than without the scrollable box around the header)
Sorry, the fix works for me. The difference can be caused by jira configuration and used plugins. Also check your syntax for jira markup, maybe there is no noformat tag in yours?
I'm using {noformat:borderStyle=none|bgColor=#ffffff} space characters here {noformat}
13

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 |

7 Comments

They are already gathering interest since 2005 (see ticket JRASERVER-6034), but still haven't implemented it. Maybe they will solve it someday. I think maybe it could also work to just put some spaces in {noformat} before and after the text, but leave the text formatted. I will try that the next time.
I just tried it but that doesn't make it better. I forgot the border of the noformat-container, which is still visible this way. So the image is still the prettiest hack.
It does not work fully but it is a great idea. I can improve formatting but I can't directly control the width.
@jws: Why doesn't it work fully for you? I used this solution a couple of times and never recognized and problems. If I set the width of the image, this will be the minimum width of the column. However it can only be used to set the minimum width, not a fixed width.
I can't tell you why specifying width doesn't work. The only part of the solution that works for me is the width of the bitmap. And that's what I am doing, I have a collection of pngs every 25 px. For a defect management tool, you'd think JIRA would have less defects.
|
7

Jira seems to expand the width of the right column to fit the contents, and this can squeeze the left column so that it doesn't fit it's contents. A workaround for this particular issue is to restrict the width of content in the right column until the left column has enough width to render properly.

One way to do this is to enter new lines into the content.

||     Parameter       || Meaning ||
| a term | A definition which contains 
lines breaks.|

Comments

6

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

1 Comment

This does not work on my side. Preview is ok but when validating modifications and refreshing page, column is still too narrow.
2

I googled for invisible unicode character, which is not a space, thus JIRA won't trimm it. The first I found and copy pasted in visuell mode while editing the table header of a JIRA comment, did the magic and I could adjust the needed column width. (Although I had to replace my spaces in the text if there were any or any other whitespace characters which could make JIRA break my header into more lines. This was the unicode character I used: https://www.compart.com/de/unicode/U+2800 (copy the text from the box)

1 Comment

This worked for me, no ugly box, no need for transparent picture. Thanks! Jira seems to recognize it as a character and not a space.
1

The {noformat} solution did not work for me and I don't have admin access to add a plugin, so I created a Chrome extension to set the minimum column width to 100 pixels. Kind of silly that it had to come to this but it gets the job done.

https://chrome.google.com/webstore/detail/jira-table-width-fixer/lgbgknkgpchdholdabagddphgaildolf/related

Comments

1

Brain-dead brain dead solution: fill header with underscores. The "noformat" trick was too ugly even for me, the   didn't work, I don't have permissions (or I'm too lazy) to find/use/install a transparent jpg... So I just used underscores. Making the header text "space-less" ("dont_squish_me" instead of "dont squish me") prevents Jira from line wrapping.

|| build || dont_squish_me || really_long_field____________________________________ ||
| [22|http://jenkins/job/JOB/22] |  5:27:50 | some extra text that might wrap |
| [23|http://jenkins/job/JOB/23] |  4:19:22 | more wrappable |

Comments

0

You should place them all in the same table for the columns widths to be the same (do not provide any space tables); for example

||Table1Col1||Table1Col2||Table1Col1Comment|Table1Col2Comment|
||Table2Col1||Table2Col2||Table2Col1Comment|Table2Col2Comment|

Hoepfully this should work.

Comments

0

To "fix" Jira task description table view column width:

Add transparent image to one of the column cells, resize the image a little bit, then switch to text mode of Description editing, find something that mentions "width", set width to the one you want, and height to 1.

In the image I set it to 230 width and 10 height.

Jira task description table view

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.