Opened 12 years ago
Last modified 8 years ago
#9020 confirmed Bug
"vertical split a cell" works error when the row contains "colpan>1" cells
Reported by: | tengshengbo | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | Core : Tables | Version: | 3.1 |
Keywords: | HasPatch Support | Cc: |
Description (last modified by )
Follow this simple steps:
- create a table with 3 rows, 3 columns.
- merge the first two cells in the first row.
- veritical split the last cell(the cell after the merged cell) in the first row.
The table structure becomes messy after the third step.
The bug is in "tabletools/plugin.js", cellInRow function. Developer should avoid adding duplicate cells, similar with "cellInCol".
Change History (4)
comment:2 Changed 12 years ago by
Description: | modified (diff) |
---|---|
Keywords: | table removed |
comment:3 Changed 12 years ago by
Keywords: | HasPatch added |
---|---|
Status: | new → confirmed |
Version: | 3.6.3 → 3.1 |
Issue reproducible in all browsers from CKEditor 3.1.
The same broken table structure is produced it TC presented in #8177. Perhaps these two bugs use the same invalid code and they can be fixed with one patch.
comment:4 Changed 8 years ago by
Keywords: | Support added |
---|
This ticket has also been reported on our support channel.
---
There are two possible sources of this problem. When you start with this table:
<table border="1" cellpadding="1" cellspacing="1" style="width:500px"> <tbody> <tr> <td>11</td> <td>12</td> <td>13</td> </tr> <tr> <td>21</td> <td>22</td> <td>23</td> </tr> <tr> <td>31</td> <td>32</td> <td>33</td> </tr> </tbody> </table>
and Merge cell 11 Right, you will get rowspan="1"
assigned to cell 1112. This assignment is really not necessary and is the first source of the problem.
<table border="1" cellpadding="1" cellspacing="1" style="width:500px"> <tbody> <tr> <td colspan="2" rowspan="1">1112</td> <td>13</td> </tr> <tr> <td>21</td> <td>22</td> <td>23</td> </tr> <tr> <td>31</td> <td>32</td> <td>33</td> </tr> </tbody> </table>
When you split vertically cell 13, new row is created and 2 is blindly added to rowspan value of cell 1112. This is another possible source of the problem.
<table border="1" cellpadding="1" cellspacing="1" style="width:500px"> <tbody> <tr> <td colspan="2" rowspan="3">1112</td> <td>13</td> </tr> <tr> <td> </td> </tr> <tr> <td>21</td> <td>22</td> <td>23</td> </tr> <tr> <td>31</td> <td>32</td> <td>33</td> </tr> </tbody> </table>
Either there should be no rowspan assignment when merging cells or rowspan value should be analysed when cell is split.
My fix for this: