Opened 14 years ago
Last modified 10 years ago
#9020 confirmed Bug
"vertical split a cell" works error when the row contains "colpan>1" cells — at Version 2
| 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 (2)
comment:2 Changed 14 years ago by
| Description: | modified (diff) |
|---|---|
| Keywords: | table removed |

My fix for this:
function cellInRow( tableMap, rowIndex, cell ) { var oRow = tableMap[ rowIndex ]; if ( typeof cell == 'undefined' ){ var oRowtemp = []; for ( var c = 0; c < oRow.length; c++ ) { oRowtemp.push( oRow[ c ] ); if ( oRow[ c ].colSpan > 1 ) c += oRow[ c ].colSpan - 1; } return oRowtemp; } for ( var c = 0 ; oRow && c < oRow.length ; c++ ) { if ( cell.is && oRow[c] == cell.$ ) return c; else if ( c == cell ) return new CKEDITOR.dom.element( oRow[ c ] ); } return cell.is ? -1 : null; }