Opened 13 years ago
Last modified 9 years ago
#8666 confirmed Bug
Wrong rowspan after vertically splitting and merging back cells
Reported by: | nitesh | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | Core : Tables | Version: | 3.1 |
Keywords: | Oracle | Cc: |
Description (last modified by )
Add a table using the default options:
<table border="1" cellpadding="1" cellspacing="1" style="width: 500px"> <tbody> <tr> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> </tr> </tbody> </table> <p> </p>
The split the first cell vertically (starting from CKEditor 4.5.0 Horizontally - #8024):
<table border="1" cellpadding="1" cellspacing="1" style="width: 500px"> <tbody> <tr> <td> </td> <td rowspan="2"> </td> </tr> <tr> <td> </td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> </tr> </tbody> </table> <p> </p>
Then merge the first cell down:
<table border="1" cellpadding="1" cellspacing="1" style="width: 500px"> <tbody> <tr> <td rowspan="2"> </td> <td rowspan="2"> </td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> </tr> </tbody> </table> <p> </p>
It should revert to the original layout, i.e. the first set of html pasted, but instead the first row ends up with four table cells, and the second row ends up with just two.
Change History (8)
comment:1 Changed 13 years ago by
Description: | modified (diff) |
---|
comment:2 Changed 13 years ago by
Status: | new → confirmed |
---|---|
Version: | 3.6.2 → 3.1 |
comment:3 Changed 13 years ago by
In latest CKEditor 3.6.2 there is also extra colspan.
<table border="1" cellpadding="1" cellspacing="1" style="width: 500px;"> <tbody> <tr> <td colspan="1" rowspan="2"> </td> <td rowspan="2"> </td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> </tr> </tbody> </table>
comment:4 Changed 13 years ago by
Component: | General → Core : Tables |
---|
comment:5 Changed 13 years ago by
Would anyone be able to advise what the ETA is on this to be assigned?
comment:6 Changed 13 years ago by
#9033 was marked as duplicate
Proposed fix from #9033:
This bug is in "tabletools/plugin.js", mergeCells function. After removing an empty tailTr, all cells in the previous row should be updated with new rowSpan.
My fix:
var newmap = null; for ( i = count - 1; i >= 0; i-- ) { var tailTr = trs.getItem( i ); if ( !tailTr.$.cells.length ) { tailTr.remove(); \\ if (i>0){ if (!newmap){ newmap = CKEDITOR.tools.buildTableMap(table ); } var cells = cellInRow(newmap, i-1); for (var j = 0;j < cells.length;j++){ if (cells[j].rowSpan>1){ cells[j].rowSpan = cells[j].rowSpan-1; } } } count++; continue; } }
comment:7 Changed 13 years ago by
Hi there, I have looked at this fix that j.swiderski kindly posted, and it seems to work. Could someone from the dev team verify and integrate it if possible?
comment:8 Changed 9 years ago by
Description: | modified (diff) |
---|---|
Keywords: | Oracle added |
Issue has been reproducible from CKEditor 3.1
Related tickets are: #6111, #8177