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

Hierarchical cell merge #198

Open
janisz opened this issue Nov 30, 2021 · 1 comment
Open

Hierarchical cell merge #198

janisz opened this issue Nov 30, 2021 · 1 comment

Comments

@janisz
Copy link

janisz commented Nov 30, 2021

Let's say we have following table:

0 1 2 3
A a c 0
A b c 0
A b d 0
B b d 0
writer.SetHeader([]string{"0", "1", "2", "3"})
writer.Append([]string{"A", "a", "c", "-"})
writer.Append([]string{"A", "b", "c", "-"})
writer.Append([]string{"A", "b", "d", "-"})
writer.Append([]string{"B", "b", "d", "-"})
writer.Render()

SetAutoMergeCells(false)

+---+---+---+---+
| 0 | 1 | 2 | 3 |
+---+---+---+---+
| A | a | c | - |
+---+---+---+---+
| A | b | c | - |
+---+---+---+---+
| A | b | d | - |
+---+---+---+---+
| B | b | d | - |
+---+---+---+---+

SetAutoMergeCells(true)

+---+---+---+---+
| 0 | 1 | 2 | 3 |
+---+---+---+---+
| A | a | c | - |
+   +---+   +   +
|   | b |   |   |
+   +   +---+   +
|   |   | d |   |
+---+   +   +   +
| B |   |   |   |
+---+---+---+---+

I'd like to get hierarchical merging: cells are merged only if prepending cell was merged. How can I achieve this?

+---+---+---+---+
| 0 | 1 | 2 | 3 |
+---+---+---+---+
| A | a | c | - |
+   +---+---+---+
|   | b | c | - |
+   +   +---+---+
|   |   | d | - |
+---+---+---+---+
| B | b | d | - |
+---+---+---+---+
@dwertent
Copy link

Does this project have maintainers?

If so, I will like to fix this.
If not, I don't mind taking over the project.

I have other issues with this table I'm planning on fixing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants