-
Notifications
You must be signed in to change notification settings - Fork 185
[Table Improvements] Fill table gaps #3272
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR implements automatic gap-filling for tables with irregular row lengths, ensuring all rows have the same number of cells by adding spanned cells where needed. This is particularly useful when pasting complex tables from external sources that may have inconsistent cell counts per row.
Changes:
- Added logic to track the maximum column count across all table rows
- Implemented gap-filling that extends short rows with
spanLeftcells matching the properties of the last cell in each row - Added comprehensive test coverage for various gap-filling scenarios including simple short rows, header cells in short rows, and tables with colspan
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/roosterjs-content-model-dom/lib/domToModel/processors/tableProcessor.ts | Implements the core gap-filling logic by tracking maxColumns and filling short rows with spanLeft cells that inherit properties from the last cell |
| packages/roosterjs-content-model-dom/test/domToModel/processors/tableProcessorTest.ts | Adds new test cases for gap-filling scenarios and updates existing tests to reflect the uniform table structure created by gap-filling |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Uh oh!
There was an error while loading. Please reload this page.
When pasting a complex table, with different cell number in each row, fill the gaps with spanned cells, making the table model uniform.