This repository has been archived by the owner on Jan 2, 2019. It is now read-only.
Fix merged-cell borders on HTML/PDF output #154
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
HTML Writer will colspan/rowspan merged cells from the base cell but only apply the base cell's formatting. As a result, borders that are applied to right/bottom edges of merged blocks are being ignored.
Not the most elegant approach but is functional and performant. Essentially force all non-none borders to be !important css attributes, then apply both base Cell and last Cell styleXf Classes to the base cell. The !importants will override the base cell none borders for right and bottom.
Alternative approach I guess would be to check for merged cells during class generation and use getBottom() and getRight() calls against the last cell rather than the base cell. I had attempted this a few months ago but dropped it due to poor performance.