Hi there,
I am trying to create a table where each of the header cells has its text rotated -90 degress without line breaks. I have gotten this far by hardcoding the cell height:
#let header = ("Name", "Maths", "Physics", "French", "Computer Science")
#let body = (
"Tomás", "A+", "A", "B-", "A++",
"Alice", "B", "B+", "A", "A",
"Bob", "C+", "B-", "C", "A-",
)
#table(
columns: header.len(),
rows: (5cm, auto),
align: center,
table.header(
..header.map(h =>
place(bottom + left, rotate(-90deg, strong(h)))
)
),
..body.flatten(),
)
Note that my goal is to be able to read a CSV which has particularly long headers, and the cell contents are all single or double digit numbers, hence the reason for the automatic single-liner vertical header text.
The output of my snippet of code breaks “computer science” into two lines, and also has poor alignment on the first column:
I tried wrapping the text in a box()
because I thought it would prevent the lines from breaking but it didn’t change the result.
I also found this very interesting post about headings at 45deg angles, but that technique didn’t prevent the lines from breaking.
Is there a way to accomplish the desired effect?