You cannot just have less columns on a row then on another row.
Formatting output is better done with a front-end application, like SSRS.
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP