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

Copy/paste table from Excel does not retain border value #1490

Closed
prmur opened this issue Jan 24, 2018 · 12 comments · Fixed by #2219
Closed

Copy/paste table from Excel does not retain border value #1490

prmur opened this issue Jan 24, 2018 · 12 comments · Fixed by #2219
Assignees
Labels
plugin:pastefromword The plugin which probably causes the issue. status:confirmed An issue confirmed by the development team. support:2 An issue reported by a commercially licensed client. target:major Any docs related issue that should be merged into a major branch. type:feature A feature request.
Milestone

Comments

@prmur
Copy link

prmur commented Jan 24, 2018

Are you reporting a feature request or a bug?

Feature request

Provide detailed reproduction steps (if any)

  1. In Excel, create a table ( 3 by 5) with thick border only in the outer cells. Add some values in the cells.
  2. Copy the table and paste in CKEditor ( Standard or Full verison 4.8.0)
  3. Table is pasted with cell values and cell background color, but the cell border is not retained correctly.

Expected result

After pasting the table in CKEditor, it should retail the border properties.

Actual result

Table is pasted with cell values and cell background color, but the cell border is not retained correctly.

Other details

  • Browser: IE 11, Chrome 63.0.3239
  • OS: Windows 10
  • CKEditor version: 4.8.0 (Standard and Full)
  • Installed CKEditor plugins: All standard plugins came with package

image

@jacekbogdanski jacekbogdanski self-assigned this Jan 31, 2018
@jacekbogdanski
Copy link
Member

jacekbogdanski commented Jan 31, 2018

Hello,

currently we are not supporting retaining border values on paste from Excel. As I checked we could provide this feature because Excel gives us information about border values (you can use this codepen to verify). We are always listing to our community and you can be sure we will deeply examine this feature request. You can follow this issue for more information about ongoing process.

@jacekbogdanski jacekbogdanski added status:confirmed An issue confirmed by the development team. type:feature A feature request. plugin:pastefromword The plugin which probably causes the issue. labels Jan 31, 2018
@jacekbogdanski jacekbogdanski removed their assignment Jan 31, 2018
@mlewand mlewand added the target:major Any docs related issue that should be merged into a major branch. label Jan 31, 2018
@jacekbogdanski
Copy link
Member

jacekbogdanski commented Mar 27, 2018

When pasting from Excel we receive border style with windowtext property which should be fixed. (e.g. removed or replaced). The reason is missing browsers support for windowtext color.

We cannot just remove this property from the applied style - in that case table cells will use user agent stylesheet which is grey because a border style for pasted table is written as a shortcut e.g. border: 0.5pt solid windowtext;. Without specified color we have to write border styles separately e.g. border-width: 0.5pt; border-style: solid; so they will be correctly applied to child cells or just use default black color.

The second option is easier to implement thus we will go with it. But with that we are forcing default color as black so we should keep an eye open because it could provide some issues where windowtext color is supported and it's different than black.

@prmur
Copy link
Author

prmur commented Apr 2, 2018

Thanks for the update. Will this solution work for border with different color ?
image

@jacekbogdanski
Copy link
Member

Yes, this feature should cover preserving border colors.

@zhangqhzz
Copy link

#2295
It is not a border color problem. When ckeditor is in a table, it will mix with the external TABLE.

@mlewand
Copy link
Contributor

mlewand commented Aug 9, 2018

@zhangqhzz I believe you're trying to answer #2295 (comment) - so your comment shuold be placed in #2295 rather than in this issue.

@mlewand mlewand added this to the Backlog milestone Nov 8, 2018
@mlewand mlewand added the support An issue reported by a commercially licensed client. label Nov 8, 2018
@jswiderski
Copy link
Contributor

Similar problems concern pasting from MS Word. Please have a look at attached Word file and try to paste the table into editor (for simplicity, you can set extraAllowedContent : 'tr td{*}(*)[*]' to avoid any ACF filtering).

  1. Broders colors are not retained in all cases (Please inspect e.g. Chippen cell). If you have style border:solid windowtext 1.0pt, this gets split in the editor to border-style:solid; border-width:1.0pt; but the windowtext color is ignored what results in some borders missing or getting default grey color.
  2. The order or some styles properties gets inverted. Please inspect e.g. Meloxidyl cell.Browser sees that style as <td style="width:144.0pt;border:none;border-bottom:solid windowtext 1.0pt; but the editor sees it as <td style=" border-bottom:solid windowtext 1.0pt; border-style:none;. Please note that border:none style is now second what results in missing border for that cell.
  3. If you also check left and right aligned tables (Direct na de operatie: Rekening opgemaakt) you will notice that Browser sees <table class="MsoTableGrid" style="border-collapse:collapse;mso-table-layout-alt:fixed;border:none; mso-border-alt:solid windowtext .5pt;mso-yfti-tbllook:1184;mso-padding-alt: 0cm 5.4pt 0cm 5.4pt" cellspacing="0" cellpadding="0" border="1"> while CKEditor converts it to <table style="border-collapse:collapse; border:solid windowtext 1.0pt" class="MsoTableGrid" cellspacing="0" border="1">. As you can see there is extra border:solid windowtext 1.0pt being added and there is no border:none;.

Nuland OK formulier.zip

@jswiderski
Copy link
Contributor

From what I have checked the pull request works very well with document attached in previous comment.

The only problem is with Chrome which doesn't see cell widths in one table properly however from what I have checked, the HTML and styling are the same. It is Chrome which calculates it incorrectly (you can take HTML from FF, save it on page in contenteditable filed and fire that file in Chrome).

image

@jacekbogdanski
Copy link
Member

The feature is available for early preview at https://ckeditor4-preview.ckeditor.com/t/1490/samples/index.html
Be aware that the implementation may change.

@lslowikowska lslowikowska added support:2 An issue reported by a commercially licensed client. and removed support An issue reported by a commercially licensed client. labels Dec 14, 2018
@jswiderski jswiderski modified the milestones: Backlog, 4.11.2 Dec 18, 2018
@mlewand mlewand modified the milestones: 4.11.2, 4.11.3 Jan 3, 2019
@mlewand
Copy link
Contributor

mlewand commented Jan 3, 2019

Moving the issue to 4.11.3 - @jacekbogdanski is off and can't conclude the pull request. And we need to make a development cut to release 4.11.2.

@mlewand mlewand modified the milestones: 4.11.3, 4.12.0 Feb 1, 2019
@JohnCSMoodys
Copy link

JohnCSMoodys commented Feb 19, 2019

The feature is available for early preview at https://ckeditor4-preview.ckeditor.com/t/1490/samples/index.html
Be aware that the implementation may change.

Do you have this issue fixed in a release ? Is this a fix to the pastefromword plugin?
May i know just the changes made to fix this issue?

@inquistive
Copy link

I am trying to paste the Bordered content from excel to text box , and the content got pasted but not the border.
Steps : Apply border to the content of excel , copy bordered data and paste on textbox.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plugin:pastefromword The plugin which probably causes the issue. status:confirmed An issue confirmed by the development team. support:2 An issue reported by a commercially licensed client. target:major Any docs related issue that should be merged into a major branch. type:feature A feature request.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants