Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Formatting of plain text outputs from table transformer

Green_ Desmond
Contributor
December 7, 2023

How do I better format text coming from a table transformer macro, where the results are in plain text?

With a table transformer macro returning plain text, my page is structured as per the below.

Query as text formatting.JPG

The plain text from the table transformer gets displayed on a new line and I seem to have little control over the formatting of this text.

Query as text formatting 2.JPG

There is static text 'Hybrid' with a H3 heading, to which I probably want to postfix a date, in the same format, coming from a table transformer. To be clear, I might like to format the text as follows:

Hybrid 28/11/2023

The same is true of the next column, 'Cloud' plus date.

How do I get more control over the formatting of plain text from the table transformer?

 

1 answer

1 accepted

3 votes
Answer accepted
Stiltsoft support
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 7, 2023

Hi @Green_ Desmond ,

I think we've already had questions where you changed font size, here is an example: https://docs.stiltsoft.com/tfac/cloud/advanced-table-cells-formatting-58426218.html#Advancedtablecellsformatting-Сhangingfontsize,style

So, you'll be able to make your text bigger.

To place a macro on the same level as your heading is not possible, so the workaround may be to put the description inside your SQL query as well.

For example, 

SELECT CONCAT("Hybrid ", FORMATDATE(MAX('Date'))) AS 'Max Date'
FROM T1

will give me 

Hybrid 03 Nov 2023

Now you'll be able to set a bigger font for the whole phrase.

Thu 12-3.png

SELECT
FORMATWIKI("{cell:font-size=50px|font-weight=bold}", CONCAT("Hybrid ", FORMATDATE(MAX('Date'))), "{cell}")
AS ''
FROM T1

Green_ Desmond
Contributor
December 8, 2023

Yes, the problem may be that in this case I don't want another table or cell, as it is already just some text I want to show in the top row of an existing table, effectively as the table header (and formatted appropriately). Otherwise, I end up with another table/cell where really I don't want one. It doesn't look so good!

formatted header.JPG

So, I have set the table transformer to return plain text, as I mentioned. So that doesn't allow formatting of that output, possibly unsurprisingly.

Stiltsoft support
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 8, 2023

Yes, you are correct - the plain text means exactly as it is: simple "paragraph" Confluence text.

So, no other workarounds from our side, unfortunately.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events