How can I reference a table that has been rotated?

I want to rotate a table. The table guide works fine, except the referencing of this rotated table.
I says: “Cannot reference rotate …”
Is this impossible or do you know a way around?
I would really like to reference this rotated table in an orderly way. Thanks a lot!

You have probably attached the label directly to rotate, but you have to use a figure like this:

#figure(
  rotate(
    -90deg,
    reflow: true,
  
    table(
      columns: 2,
      
      [T], [1],
      [T], [2],
    ),
  ),
  caption: [A caption]
) <mytable>

Reference to mytable @mytable
Output

test

Edit: added output with a caption

1 Like

Thanks.
I was using a close variation of the table guide like this:

#set page("a4", columns:  1, numbering: "— 1 —")
#show table.cell.where(y: 0): set text(weight: "bold")

#rotate(
  -90deg,
  reflow: true,

  table(
    columns: (1fr,) + 3 * (1fr,),
    inset: (x: 0.6em,),
    stroke: (_, y) => (
      x: 1pt,
      top: if y <= 1 { 1pt } else { 0pt },
      bottom: 1pt,
    ),
    align: (center, left, left, left, right, left),

    table.header(
      [P],
      [I], [Cn],
      [N],
    ),
 
    [],  [], [], [],
    [],  [], [], [],
    [],  [], [], [],
  ),
  caption: [results for design B],
) <probe-b>

… and finally the caption and the referencing via did not work.
May be space was not sufficient with all my text? Even with less text it was not ok.
Thanks a lot! Very helpful!

Thanks, it works!!! Lovely.
The figure caption itself is not in rotation, but that´s fine. May I Ask: How do I include the Table Nr. and the accompaning caption in the rotation?

It is not enough to put the figure inside the rotation because the label can only be attached to an element in content mode. So you have to do it like this:

#rotate(
  -90deg,
  reflow: true
)[
  #figure(
    table(
      columns: 2,
      
      [T], [1],
      [T], [2],
    ),
    caption: [A caption]
  ) <mytable>
]

Reference to mytable @mytable
Output

test

Please use code blocks in your posts like this:

```typ
your code goes here
```
2 Likes