Mapped values for 'tab' type columns

Me again.

I have a query and I want the data from the query to populate the 'tab' selection options in a table.

Here is the query and its output:

and here's what I'm trying to do with it:

image

I realise that I'm beating my brains out over a tiny bit of js syntax and that the answer will be really simple. Please put me out of my misery!

Many thanks as always...