ckeditor4 icon indicating copy to clipboard operation
ckeditor4 copied to clipboard

When table with header is copied all it contents is wrapped inside thead tag

Open f1ames opened this issue 8 years ago • 6 comments

Are you reporting a feature or a bug?

Bug

Check if the issue is already reported

Extracted from #417.

Provide detailed reproduction steps (if any)

  1. Set editor content to
<table border="1" cellpadding="1" cellspacing="1" style="width:500px">
	<thead>
	<tr>
		<th scope="col">1</th>
		<th scope="col">2</th>
	</tr>
	</thead>
	<tbody>
	<tr>
		<td>3</td>
		<td>4</td>
	</tr>
	</tbody>
</table>

<p>Foobar</p>
  1. Select and copy table.
  2. Paste.

Expected result

The table structure is the same as copied part.

Actual result

Whole table content is wrapped inside thead tag:

<table border="1" cellpadding="1" cellspacing="1" style="width:500px">
	<thead>
		<tr>
			<th scope="col">1</th>
			<th scope="col">2</th>
		</tr>
		<tr>
			<td>3</td>
			<td>4</td>
		</tr>
	</thead>
</table>

Other details

  • Browser: All browsers supporting tableselection plugin.
  • OS: Checked on OS X.
  • CKEditor version: 4.7.0
  • Installed CKEditor plugins:
config.plugins =
	'table,' +
	'tableresize,' +
	'tableselection,' +
	'toolbar,' +
	'wysiwygarea';

f1ames avatar May 31 '17 08:05 f1ames

This bug still occurs for CKEditor 4.10 (nightly). Do we have some update on the progress?

pgrunewald avatar Jun 19 '18 08:06 pgrunewald

This bugs seems to be fixed with version 4.11.4.

pgrunewald avatar Jul 01 '19 14:07 pgrunewald

This bugs seems to be fixed with version 4.11.4.

Let's recheck if it's already fixed.

f1ames avatar Mar 12 '21 15:03 f1ames

The issue is still reproducible on the latest master :disappointed:

Comandeer avatar Mar 30 '21 10:03 Comandeer

Workaround:

  1. Below the problem table, create a new table with the same number of columns and two rows.
  2. In the first row of the new table, manually type the column headings. Do not copy & paste.
  3. Right-click the new table, choose Table Properties and set Headings to First Row. Adjust width field if needed.
  4. In the problem table, select all cells except for the heading row a. The easiest way to do this is: i. Click between the cell border and the first letter of the first cell ii. Scroll down to the last table row iii. Hold down the shift key iv. Click between the last letter of the last cell and the cell border. If the cell is blank, just click in the cell. v. Release the shift key
  5. Ctrl-C to copy
  6. Click in the first column, second row of the new table
  7. Ctrl-V to paste
  8. Right-click in the blank row which will now be at the bottom of the newly populated table
  9. Choose Row > Delete row to delete the blank row
  10. Save the draft

CharlesBelov avatar Aug 25 '21 22:08 CharlesBelov

At https://nightly.ckeditor.com/22-10-07-06-04/full/samples/ & chrome it seems to be fixed 🤔 ;)

sculpt0r avatar Oct 07 '22 06:10 sculpt0r