How to flexibly change order of text around rotated table?

I have a big 90 ° rotated table in my document, which needs to be broken to a separate page. I want the text around the table to automatically reflow around it to previous page, so that there are no big gaps. How to do that? The current example has huge gap on first page, the lorem text should follow directly the methods section on the first page before the table.

= Methods
We produced new methods. See @Method_table for more details

#let the-table = table(
        columns: (auto, auto, 20em, 10em,auto, auto,auto),
        align: left + top,
        table.header(
          table.cell(align: left)[Method],
          table.cell(align: left)[Application],
        ),
)


#pagebreak()
    
#align(center, rotate(
  -90deg,
  reflow: true,

  [#figure(
    the-table,
    caption: [Overview ], 
  )<Method_table>]
))

#pagebreak()

= Something else
Let's now discuss something completely else. Here's a random latin text:
#lorem(50)

Hi @Vaclav_Bocan! I am having difficulties understanding what you want to achieve. Can you try to describe more in details or draw something on a screenshot perhaps?

If you want the “something else” to follow directly after the figure, then you can remove the pagebreak() resulting in

Hi, thanks for the reply. I edited the question to make it clearer.

Thanks! I understand your question better.

If you would like your figure to span the whole page (full page figure), then you can wrap it in a box, and place a floating figure, i.e.,

#place(
  top,
  float: true,
  box(
    height: 100%,
    width: 100%,
    align(
      center,
      rotate(
        -90deg,
        reflow: true,
        [#figure(
            the-table,
            caption: [Overview ],
          )<Method_table>],
      ),
    ),
  ),
)

1 Like