How do I create a glass pane roof?

You cannot, glass panes are only vertical.

You're gonna have to use regular glass blocks unfortunately.


You need to use glass blocks. Sorry!

To keep mobs in just make 2-block high wall.


Unfortunately as the other answers say, this isn't possible in vanilla Minecraft. But you can install a mod to achieve this.

Horizontal Glass Pane mod