Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Vertical text in a table

Troy Holmes November 19, 2018

I am trying to create a column in my table that would contain vertical text. Is that possible?

3 answers

1 accepted

2 votes
Answer accepted
Josef Pavelec July 31, 2019

Hi Troy,

you can define macro (you need admin permission), go to General configuration -> User Macros -> Create a User Macro.

Enter your Macro Name and Macro Title. In Macro Body Processing select "Rendered" option. Into Template paste following code:

## Macro: rotate-table-headers
## Macro title: A macro for rotating all the headers in a table
## Macro has a body: Y
## Body processing: n/a
## Output: HTML
##
## Developed by: David Simpson <david@davidsimpson.me>
## Date created: 2013-11-20
## Installed by: My Name

## @param height:title=Height|type=string|required=true|desc=e.g.100px


<style>
/** @see: http://css-tricks.com/snippets/css/text-rotation/ */
.rotate-table th div.tablesorter-header-inner, td.confluenceTd {
-webkit-transform: rotate(-90deg);
-moz-transform: rotate(-90deg);
-ms-transform: rotate(-90deg);
-o-transform: rotate(-90deg);
transform: rotate(-90deg);

filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3); /* Internet Explorer */
}

.rotate-table th, td {
vertical-align:middle;
horizontal-align:middle;
height: $paramheight;
}

</style>

<div class="rotate-table">$body</div>

In Confluence page, use this macro and into body paste your table. It should lead into following formatting:

 Screenshot 2019-07-31 at 09.39.44.png

This post is based on https://superuser.com/questions/741451/how-do-i-create-vertical-table-headings-in-confuence%C2%A0

Jaic george March 12, 2021

How we can achieve this for a particular  TD and not for all TD's?

Like # people like this
1 vote
Daniel Sidler May 31, 2023

For anyone reaching this page via Google; the solution provided in this article does apply to Confluence DC only. On Atlassian Cloud, there is no simple way to create and maintain macros like this. See Solved: "User Macros" option not showing in "General Confi... (atlassian.com) for further info.

0 votes
Josef Pavelec July 31, 2019

Duplicate answer has been deleted

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events