There are two ways to do it Roger.
Neither are absolutely perfect but depending on what you want to achieve with the Query will dictate which path you use.
The CSS route:
If you are going to do all the work yourself.... good luck. Hand coding the CSS is more that my limited life span cares to cover.
However, there is some short cuts. There are some really good Grid foundations out there that make it a whole lot easier once
you understand how to use them. I use http://unsemantic.com/ as it is pretty straight forward and allows more columns
across the screen than some of the others. It allows Nested Columns and might meet you needs in a Custom Query but will still need some
tinkering with you own css if you want to conditionally style any of the attributes.
I used this foundation when starting to layout Mobile forms back in 5.9 and it simplified enormously.
Pros: If you are good with html and css then you could do just about anything.
Cons: Tedious.
The Presentation route:
You can set up a Presentation just as if you were building a report. Multiple lines of data per record, embedded sub queries, styled attributes....basically anything you want.
Once you have designed your Presentation....In the Custom Query choose Display Presentation rather than Display Custom Data Template (the html css route)
Pros: Much faster to design and set up. Mostly all the control you need.
Cons: You cannot select individual rows of data. But you can include record dependent links from each records - like an Edit button without to much work.
A Third Option:
This will not work for carefully placing one line of data under another in a single row. But if you want, for example, to display a long text field across more than one row in a query.... convert it into html.