How to insert page number on Nextcloud Office?

I was wondering how I add a page number to a heading on Nextcloud Office. I need this because many educational institutions (including mine) need MLA format for essays, and they require page numbers in the heading.
How do I do this? Where is the button to do so or does it even exist?
Thanks in advance!
(And yes, I know someone else made a post similar to this, but it went unanswered all the way in 2018.)