Forum How do I...?

... use both generated content and flow?

alrobins
In the standard page header for the invoice I'm designing, I'd like to have a table that contains an SVG logo, the customer's name, and a page count. Since the table and logo don't work well as @page { content: "<table>etc</table>"; }, I'm using flow(header) to get all of that up to the top. But is there any way to put the "Page 1 of 4" inside the table without having it be up in the @page declaration?

In other words, can I use both generated content AND flow(header), and if so, how?
mikeday
In other words, can I use both generated content AND flow(header), and if so, how?

Yes you can, simply create your header element and place something like this inside the table:
Page <span style="content: counter(page)"></span>
of <span style="content: counter(pages)"></span>

The empty spans will be replaced with the current page number on each page.