ckeditor5 icon indicating copy to clipboard operation
ckeditor5 copied to clipboard

Retain table column widths pasted from Google Docs

Open Dumluregn opened this issue 2 years ago • 4 comments

📝 Provide a description of the improvement

Tables with resized columns are pasted correctly from CKE4 and MS Word, but not from Google Docs. We could improve the plugin to also handle this source.


If you'd like to see this improvement implemented, add a 👍 reaction to this post.

Dumluregn avatar Jul 06 '22 11:07 Dumluregn

Mentioned in a "column width" row of https://github.com/ckeditor/ckeditor5/issues/5652#issuecomment-545472596 so let's keep it in sync in case we fix it.

I checked quickly what markup is placed on Chrome (Win10) to clipboard:

<html>

	<body>
		<!--StartFragment-->
		<meta charset="utf-8"><b style="font-weight:normal;"
			id="docs-internal-guid-aadc8e80-7fff-7116-1a20-860e04a1ca02">

			<div dir="ltr" style="margin-left:0pt;" align="left">
				<table style="border:none;border-collapse:collapse;">
					<colgroup>
						<col width="83" />
						<col width="125" />
						<col width="299" />
						<col width="17" />
					</colgroup>
					<tbody>
						<tr style="height:21pt">
							<td colspan="2"
								style="border-left:solid #000000 1pt;border-right:solid #000000 1pt;border-bottom:solid #000000 1pt;border-top:solid #000000 1pt;vertical-align:top;padding:5pt 5pt 5pt 5pt;overflow:hidden;overflow-wrap:break-word;">
								<br /></td>
							<td colspan="2"
								style="border-left:solid #000000 1pt;border-right:solid #000000 1pt;border-bottom:solid #000000 1pt;border-top:solid #000000 1pt;vertical-align:top;padding:5pt 5pt 5pt 5pt;overflow:hidden;overflow-wrap:break-word;">
								<br /></td>
						</tr>
						<tr style="height:21pt">
							<td
								style="border-left:solid #000000 1pt;border-right:solid #000000 1pt;border-bottom:solid #000000 1pt;border-top:solid #000000 1pt;vertical-align:top;padding:5pt 5pt 5pt 5pt;overflow:hidden;overflow-wrap:break-word;">
								<br /></td>
							<td colspan="2"
								style="border-left:solid #000000 1pt;border-right:solid #000000 1pt;border-bottom:solid #000000 1pt;border-top:solid #000000 1pt;vertical-align:top;padding:5pt 5pt 5pt 5pt;overflow:hidden;overflow-wrap:break-word;">
								<br /></td>
							<td
								style="border-left:solid #000000 1pt;border-right:solid #000000 1pt;border-bottom:solid #000000 1pt;border-top:solid #000000 1pt;vertical-align:top;padding:5pt 5pt 5pt 5pt;overflow:hidden;overflow-wrap:break-word;">
								<br /></td>
						</tr>
						<tr style="height:21pt">
							<td colspan="2"
								style="border-left:solid #000000 1pt;border-right:solid #000000 1pt;border-bottom:solid #000000 1pt;border-top:solid #000000 1pt;vertical-align:top;padding:5pt 5pt 5pt 5pt;overflow:hidden;overflow-wrap:break-word;">
								<br /></td>
							<td colspan="2"
								style="border-left:solid #000000 1pt;border-right:solid #000000 1pt;border-bottom:solid #000000 1pt;border-top:solid #000000 1pt;vertical-align:top;padding:5pt 5pt 5pt 5pt;overflow:hidden;overflow-wrap:break-word;">
								<br /></td>
						</tr>
					</tbody>
				</table>
			</div>
		</b>
		<!--EndFragment-->
	</body>

</html>

On paper it looks like we should handle this markup with column resize plugin enabled 🤔 BUT there are 2 things visible instantly:

  • width is passed as a HTML attribute instead of style attribute on a col element,
  • there's no wrapping figure, maybe it messes up?

Most likely the first point is the source of the problem and we'd need to add conversion for it.

mlewand avatar Aug 10 '22 12:08 mlewand

Looks promising :crossed_fingers:

Dumluregn avatar Aug 10 '22 12:08 Dumluregn

There has been no activity on this issue for the past year. We've marked it as stale and will close it in 30 days. We understand it may be relevant, so if you're interested in the solution, leave a comment or reaction under this issue.

CKEditorBot avatar Sep 30 '23 05:09 CKEditorBot