Transpose Rows & Columns with Dataview

What I’m trying to do

I’m building a new dashboard and want to use dataview to pull all books I’m currently reading and display the covers only as a banner at the top of the page.

Using the below dataview query I can get the list I want but it displays them (obviously) as a table, with each entry being its own row:

TABLE WITHOUT ID ("![|100](" + cover + ")") as "Currently Reading"
From "Books"
Where contains(status, "current")

Whereas I’d like to have them all show in the same row like this:

You might try doing some GROUP BY true, and combining that with join(map(rows.cover, (c) => "![|100](" + c + ")"), " ") or similar. That should in theory put everything on one line, but I’m not sure if or how to make it wrap if you’ve got too many books in your current reading list.

I’m also not able to fully test it, since embedding is a finicky thingy, and I don’t know how you’ve given value to your cover property so I can’t really test it.

I’m using the book search plugin with these properties:
Screenshot 2024-12-29 110541

So the ‘cover’ property is coming straight from the plugin and is just a URL to the google books image (e.g. https://books.google.com/books/content?id=VREHzN9OC0UC&printsec=frontcover&img=1&zoom=1&source=gbs_api)

It seems like my suggested code should work just nicely, so what does this query produce at your end:

```dataview
TABLE WITHOUT ID join(map(rows.cover, (c) => "![|100](" + c + ")"), " ") as "Currently reading"
FROM "Books"
WHERE contains(status, "current")
GROUP BY true
```

Update Corrected the column title

1 Like

That does the trick of listing them side-by-side, thanks! Though it does display the entire ‘join(map(rows.cover, (c) => “![|150](” + c + “)”), " ")’ in the header now:
Screenshot 2025-01-08 165221

Just add the as Books or whatever back to that line.

1 Like

Oh, duh! Thanks very much!