Skip to content
This repository has been archived by the owner on Feb 21, 2019. It is now read-only.

Support merging cells #35

Open
rendongsc opened this issue Jul 21, 2017 · 4 comments
Open

Support merging cells #35

rendongsc opened this issue Jul 21, 2017 · 4 comments

Comments

@rendongsc
Copy link

any plans to provide merge cell functionality?
thanks!

@Soreine
Copy link
Contributor

Soreine commented Sep 20, 2017

We don't plan on implementing this feature. Anyone would like to help make it happen?

Edit: To be clear on the feature, it would be like any Google Docs or Word tables. You should be able to mark a group of adjacent cells as "merged". They still occupy the same space as a group, but they are shown as one big single cell.

@Soreine Soreine changed the title cells merge support? Support merging cells Sep 20, 2017
@sebastianiorga
Copy link

Stumbled on something (I think) related: when I use the plugin with some Slate state that I've parsed, it will normalize TR nodes to have a constant number of TD elements.

So the Slate state might be based off parsing HTML that looks like:

<tr><td></td><td></td></tr>
<tr><td colspan="2"></td>

But the editor will render all <tr> elements with 2 <td> elements.

Presumably implementing colspan handling is how merge cells would work?

@aRusenov
Copy link

aRusenov commented Jun 14, 2018

At my company we're using slate in production and the merge/split was a necessity. So we've made the changes to the slate-edit-table plugin. So far we only support single-row column merge and split and they're implemented using a colspan property (the key is user-defined) set on the cell data. The behavior is mirrored from Google Docs.

@Soreine, does this sound like an acceptable implementation? I can post a PR in the upcoming days if there's interest.

@edeustace
Copy link

@aRusenov - where's your fork? I'd love to see it.

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

No branches or pull requests

5 participants