✨ New Feature: Improved Existing Table Support
What's Improved:
- Border Color Preservation: Tables loaded from content now have their border colors extracted and preserved when adding rows/columns
- Consistent Styling: All tables get normalized with proper styles for resizing (table-layout: fixed, border-collapse, etc.)
- Smart Detection: Editor automatically detects and extracts border colors from various formats (hex, rgb, rgba, named colors)
- Full Editing Support: All table editing features (add/remove rows/columns, resize, delete) work seamlessly with existing tables
📋 Test Instructions:
- Try the Red Table: Click in any cell and use the toolbar buttons to add rows or columns. Notice the new cells inherit the red border color!
- Try the Blue Table: Add rows/columns and see that the blue border color is preserved
- Try the Green Table: The green border is also maintained when editing
- Resize Columns/Rows: Hover over cell edges to see resize handles - all tables are now resizable
- Delete Tables: Place cursor in any table and click the delete table button to remove it
🔍 Technical Details
Border Color Extraction: The editor now automatically extracts border colors from existing tables when they're loaded. It supports:
- Hex colors (#RGB, #RRGGBB)
- RGB colors (rgb(r, g, b))
- RGBA colors (rgba(r, g, b, a))
- Named colors (red, blue, green, etc.)
Table Normalization: When tables are detected, the editor:
- Extracts the border color from the first cell (if available)
- Stores it as a data-border-color attribute on the table
- Applies table-layout: fixed for predictable resizing
- Ensures border-collapse and width styles are set
- Applies consistent padding and borders to all cells
Backward Compatibility: Tables without explicit border colors get a default color (#ddd), and all existing custom styles are preserved.