When table with header is copied all it contents is wrapped inside thead tag
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)
- 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>
- Select and copy table.
- 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
tableselectionplugin. - OS: Checked on OS X.
- CKEditor version: 4.7.0
- Installed CKEditor plugins:
config.plugins =
'table,' +
'tableresize,' +
'tableselection,' +
'toolbar,' +
'wysiwygarea';
This bug still occurs for CKEditor 4.10 (nightly). Do we have some update on the progress?
This bugs seems to be fixed with version 4.11.4.
This bugs seems to be fixed with version 4.11.4.
Let's recheck if it's already fixed.
The issue is still reproducible on the latest master :disappointed:
Workaround:
- Below the problem table, create a new table with the same number of columns and two rows.
- In the first row of the new table, manually type the column headings. Do not copy & paste.
- Right-click the new table, choose Table Properties and set Headings to First Row. Adjust width field if needed.
- 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
- Ctrl-C to copy
- Click in the first column, second row of the new table
- Ctrl-V to paste
- Right-click in the blank row which will now be at the bottom of the newly populated table
- Choose Row > Delete row to delete the blank row
- Save the draft
At https://nightly.ckeditor.com/22-10-07-06-04/full/samples/ & chrome it seems to be fixed 🤔 ;)