Hi, it's me again, sorry lmao
Well, I am confused, because in Strapi there the label "table" like this:
How can I create a customize label?
Other example in Slate
you can recreate that exact element from Slate, but I do think we need to add support for tables natively in Payload
tables and rich text are tough. Generally what we do is just make a "markdown" field when we need tables and then draw out the markdown table. You can see that on our website
How can I make it?
I mean, is with Slate package?
All of the code for the Slate example is available right on that site above:
Sorry, I don't undestand
I mean, I can put a table field in Rich text?
it is technically possible to be able to put a table inside a rich text editor, but you need to manually extend Payload's rich text editor to be able to support that—using the code in the example above
Hey @jmikrut 👋 Messaging here instead of starting a new thread on same topic - are there are any plans to add tables natively to Payload's richText field? Or otherwise make it easier to do so, with a new plugin system of some kind?
Asking so I know whether it's worth me starting on a custom integration, or if I'd be better off waiting for Payload's own solution. Thanks! Loving Payload so far 😀
that is a good question
right now there is a separate thread going about how we might build in Lexical editor support, which has native tables that are super nice
but regarding tables in Slate, we will absolutely be getting to that one way or another, although it could be some time yet before we tackle it. We have a LOT on our plate for Q1 2023
Yes I've seen your roadmap! Exciting stuff 🥳 Thanks for confirming your plans.
I've seen @Alessio 🍣 's PR for a Lexical integration. Super cool. I'd be excited to help test this as a plugin. Tables are the missing piece for the content workflow in my current project!
Currently working on a plugin version!
However, Meta's team currently has 2 table implementations: the basic one and the "experimental" one (which is way nicer).
Since the experimental one changes what's outputted as json, I'm planning to wait until the experimental one is stable and use that one - until then disable the table plugin. Reason is future-proofing as if I use the standard table plugin now, I can't switch to the new one in the future as the data might break
Sounds great, thanks! I'm watching the GH thread, looking forward to testing out your Lexical plugin 😀
Hey Alessio have you managed to implement the the table. If you have would it be possible to share a gist of it
Hey, just updated the plugin to better support tables!
for an example for enabling them
Still disabled by default since I dont know which table type to use (standard or experimental), but it's easy to enable it
works very well though!
@Alessio 🍣 is there any issue if I use the experimental table ?
eh I don't think it works that well, I'd personally just use the normal table
Keep in mind not to use any tables if you have more than 2 richtext fields on one single page (e.g. through the blocks fields) though. There's a lexical bug which glitches them out - will be fixed prob in the next lexical version