It is a matter of customising paragraph style Footer which is used by default in page footer. In case you used some other style, customise the effective one.
Open the Footer style and go to its Tabs tab. You can’t modify tab settings, you must delete and recreate them. There are two tab stops: one for the center and one for the right margin.
You must make an “aesthetic” decision as to which character will be used for the line and if this line should be contiguous:
- U+002D HYPHEN-MINUS - at mid-character height, not continuous, available in the dialog
- U+005F LOW LINE _ slighly below the base line, continuous, available in the dialog
- U+2015 HORIZONTAL BAR ― at mid character height, continuous, must be specified by user
With an A4 paper sheet and default 2 cm margins, tabs have the following properies:
- 8,5 cm, centered, add the fill character of your choice
- 17 cm, right aligned, add the fill character of your choice
When you compose your footer, type the sequence Tab<page number field>Tab. The second tab is necessary to trigger the right leading line. If you prefer that the page number is better visible, add spaces around the field.