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.
9 Answers
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.
3 Comments
{noformat:borderStyle=none|bgColor=#ffffff} space characters here {noformat}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
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
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.
1 Comment
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
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.
Comments
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
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.
