-
Notifications
You must be signed in to change notification settings - Fork 147
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
Fix merge cells style problem when using table substitution #174
Conversation
Thanks for contribution. Can you add test case which validates your scenario, once it is done, I would gladly accept this PR |
@@ -1137,6 +1139,23 @@ module.exports = (function() { | |||
|
|||
// Add the cell that previously held the placeholder | |||
newRow.append(newCell); | |||
|
|||
if(mergeCell) { | |||
var mergeRange = self.splitRange(mergeCell.attrib.ref), |
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.
can you use let
instead of var
and make each variable as separate variable on individual line.
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.
Ok! I'll work on it
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.
Do you have a chance to work on the suggestions?
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.
Hello,
Thanks for very useful library.
I really need this feature.
Can I know why not merged yet?
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.
@muyoungko can I assume that you take care of this scenario in #188 ?
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.
Yes~
Thanks for filing this PR. Unfortunately due to long time other contributor come along and provide this fix with tests |
Reproduce The Error
Template

Output

Resolution
In source code Workbook.prototype.substituteTable function
First declare a mergeCell variable represent the current cell equals to the start cell of some mergeCells
const mergeCell = self.sheet.root.findall("mergeCells/mergeCell").find(c => self.splitRange(c.attrib.ref).start === cell.attrib.r)
Second, if current cell is the start cell, copy the original merge cells, then for loop to append the last of cells in mergeRange