Yes there is a way to do it. However, you have to first know what you want. WHAT exactly needs to be printed next to what? Vague requirements like "I need to print things next to each other" don't tell anyone what you need. And further, indicate you don't know what exactly you need.
So, figure out what exactly you want done, and explain it to us. Often, that will be enough to get you to know what you need to do.
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors