Probably depends on what version of Confluence you're using, and probably not very simply or easily unless you're happy fiddling around with the files that make up the documentation theme.
Having said all that, I'm just guessing but this might work for 3.x - have a look at the pagetree2 macro from Adaptavist - https://www.adaptavist.com/display/Builder/pagetree2+macro.
It's officially Tuesday, which means it's officially time for another tip to help you better navigate this space we call the Atlassian Community. 😄 I got a great question from community member, Sa...
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs