How to have title center aligned with page number right aligned in Header?

I’m trying to format my page to have the title in the center then the page number to be aligned to the right.

But it looks like it’s impossible to do. Either everything is center-aligned or everything is right-aligned. I tried pressing tab after the title, but it just pushes the page number to the right while the title is pushed to the left.

I was able to do it by having the first line be a centered title, then the second line be the right-aligned page number. But this is a waste of space and I want it to be on the same line.

Built-in Header paragraph style has everything you need. It will work provided you haven’t already tried to “massage” it.

First revert to factory settings. If you have not customized Header paragraph style, select all you header and Ctrl+M or Format>Clear direct-formatting.

Compose your header as Tab to skip to second “field” and type your title, then Tab again and Insert>Field>Page Number.

Header paragraph style is configured for a first part left-aligned on the left margin, a second part centered in the middle and a third part right-aligned on the right margin.

To show the community your question has been answered, click the ✓ next to the correct answer, and “upvote” by clicking on the ^ arrow of any helpful answers. These are the mechanisms for communicating the quality of the Q&A on this site. Thanks!

In case you need clarification, edit your question (not an answer which is reserved for solutions) or comment the relevant answer. Don’t forget to mention your OS name, LO version and format under which you save your document ( .odt or .doc(x)).

Thank you, this was exactly what was needed. Spent over an hour looking through tutorials. Thanks!

In the horizontal ruler you can see the tab marks.

image description