﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
10682	Cannot set tablet headers back to None on table with one row	nitesh		"When a table has one row, and Headers are set to Both.  It is not possible to go back into table properties and set the headers back to None.

'''Steps to reproduce:'''

1. Create a table with 1 row, 2 columns, Headers: Both
2. Enter Table Properties and set Headers: None
3. Click OK

'''Expected results:'''

* Dialog exits and TH in the table are replaced with TD.

'''Actual results:'''

* Dialog does not exit and there is a JavaScript error.

Here is one possible fix, applied to ckeditor/_source/plugins/table/dialogs/table.js (Note that this code segment is from version 3.6.5, although the bug is present in the latest version too):



{{{
// Move the row out of the THead and put it in the TBody:
thead = new CKEDITOR.dom.element( table.$.tHead );
tbody = table.getElementsByTag( 'tbody' ).getItem( 0 );

var previousFirstRow = tbody.getFirst();
while ( thead.getChildCount() > 0 )
{
    theRow = thead.getFirst();
    for ( i = 0; i < theRow.getChildCount() ; i++ )
    {
        var newCell = theRow.getChild( i );
        if ( newCell.type == CKEDITOR.NODE_ELEMENT )
        {
            newCell.renameNode( 'td' );
            newCell.removeAttribute( 'scope' );
        }
    }
    if ( previousFirstRow )
        theRow.insertBefore( previousFirstRow );
    else 
        theRow.appendTo( tbody );
}
thead.remove();
}}}"	Bug	confirmed	Normal		General	4.2			
