✨Discover storytelling in the AI age with Pixar's Matthew Luhn at Sanity Connect, May 8th—register now

Discussion about the limitations of a table plugin and alternative solutions for creating tables in Sanity.io.

12 replies
Last updated: Oct 5, 2023
Is there a way to have this table plugin (https://www.sanity.io/plugins/sanity-table ) have table headers? Or are we supposed to on our end just assume the first row is the table headers?
Oct 3, 2023, 5:23 PM
I don’t believe you can set up headers with that bad boy.
Oct 3, 2023, 5:33 PM
😭 dang yeah I’ve been looking for a table that allows that and allows images in the cells
Oct 3, 2023, 5:34 PM
Trying to recreate this
Oct 3, 2023, 5:34 PM
If there was something that did that, plus rich text inside of the cells it would be :chefs-kiss:. It could probably end up being an attribute nightmare, though.
For what you shared, you probably just have to assume that the first row contains the headers
Oct 3, 2023, 5:36 PM
Yeah I’m also wondering if it would be better to just have like an array of voters and then just render accordingly?
Oct 3, 2023, 5:37 PM
That’s what I tend to go with. I don’t use the table plugin, instead I create an array of objects then handle rendering it as a table on my FE if I need to. Some editors can find that confusing, though, and need the table visual when they’re in the PTE.
Oct 3, 2023, 5:41 PM
But I have the preview tab in my sanity studio so they should be able to just go to that and see it if they need to
Oct 3, 2023, 5:41 PM
Nice. You’re all set then 😎
Oct 3, 2023, 5:42 PM
So I ended up figuring it all out
Oct 5, 2023, 3:49 AM
This is what it looks like
Oct 5, 2023, 3:51 PM
No problem!
Oct 5, 2023, 5:05 PM
Dope. Thanks for sharing!
Oct 5, 2023, 5:05 PM

Sanity– build remarkable experiences at scale

Sanity is a modern headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.

Was this answer helpful?