Textbox text alignment left and right in same line

I am using LibreOffice Writer 6.3.5.2.
I have to use textboxes on every page for the project. At the top of the textbox I want to write something with a left and right alignment in the same line.
If I don’t use a textbox I would just use the tab stops and choose left and right alignment. But when I use them in the textbox it doesn’t work.
I have added a picture of how I would do it without a textbox and what happens if I do the same with a textbox.

The picture makes it very obvious that the tab stops are applied to the page and not to the textbox, so my question is how can I do the same for the textbox?

Tab stops.jpg

Try to insert a frame instead of a textbox.

Frame content can take mostly the same formatting as plain page content.

Some graphical manipulation allowed for a textbox is not possible for a frame.

Thanks a lot. That really solved a lot of problems. Now I just have to copy around 60 pages into that format. But the next 1000 pages is going to be a lot easier.
Really appreciate the fast and clear answer.