To add ad-hoc HTML tables in your CMS Richtext content in Webflow without requiring clients to edit HTML markup directly, you can use a combination of custom code and the use of the Embed element. Here's how you can achieve this:
Step 1: Create a Custom Embed Field
1. Go to your Webflow project's Settings.
2. Select the Collection that contains the Richtext field where you want to add the HTML table.
3. Click on "Fields" and then "Add Field" to create a new field.
4. Choose "Embed" as the field type.
5. Give the field a name (e.g., "HTML Table").
Step 2: Add the HTML Table as an Embed Component
1. Open the CMS Editor for the specific item where you want to add the ad-hoc HTML table.
2. Insert an Embed component within the Richtext field.
3. Click inside the Embed component and select the "Form" tab in the right panel.
4. Choose the appropriate collection field you created in Step 1 ("HTML Table") and insert the Table HTML code.
Step 3: Style the HTML Table
1. Select the Embed component that contains your HTML Table.
2. Apply the desired styling by adding classes to the Embed component and targeting it with custom CSS, either within the Webflow Designer or by exporting your code and modifying it externally.
Step 4: Populate the HTML Table in the CMS Editor
1. Save your changes and return to the CMS Editor.
2. You'll now see the Embed component within the Richtext field.
3. Click on it and a textarea will appear where you can input the code for your HTML table.
4. Once you've input your table code, the ad-hoc HTML table will appear in the Richtext field.
By following these steps, you can allow your clients to add ad-hoc HTML tables within the CMS Richtext content without the need to directly edit HTML markup, making it a user-friendly option while maintaining flexibility.