Skip to content
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

How to merge two cells? #3

Open
jeffreyrajanofficial opened this issue Sep 15, 2023 · 1 comment
Open

How to merge two cells? #3

jeffreyrajanofficial opened this issue Sep 15, 2023 · 1 comment
Labels
question Help needed by users

Comments

@jeffreyrajanofficial
Copy link

Hi, I'm interested in combining two cells into a single cell, similar to how it's done in Excel. Is there a method to accomplish this?

@sunny-chung
Copy link
Owner

Hi, you will need to fork this library and modify with below changes, because this does not align with the direction of the library at this moment.

  1. Modify the way of getting cell components, so that the Table component knows which cells are merged and their position index.
  2. For content cells, in measurement stage, instead of passing width/height of single column/row as maximum width/height constraints, pass sum of width/height of all relevant columns/rows.
  3. For content cells, In each layout pass, if the cell is a merged cell, you would skip the original handling that calculates and stores maximum width/height needed per column/row based on cell size, and instead if the merged cell size exceeds sum of width/height of all relevant columns & rows, their width/height will be increased proportionally so that their sum is at least the required size (if not bounded by required maximum width/height per column/row).
  4. For sticky header cells, similar modification is needed, but the difference is in the measurement stage that, sum of width/height of all relevant columns/rows is passed as the exact size constraint.

@sunny-chung sunny-chung added the question Help needed by users label Sep 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Help needed by users
Projects
None yet
Development

No branches or pull requests

2 participants