- eCaption.innerHTML = document.getElementById('txtCaption').value ;\r
- }\r
- else if ( bExists && eCaption )\r
- {\r
- if ( oEditor.FCKBrowserInfo.IsIE )\r
- eCaption.innerHTML = '' ; // TODO: It causes an IE internal error if using removeChild or table.deleteCaption().\r
- else\r
- eCaption.parentNode.removeChild( eCaption ) ;\r
+ if ( table.tHead!==null && !(headers=='row' || headers=='both') )\r
+ {\r
+ // Move the row out of the THead and put it in the TBody:\r
+ var tHead = table.tHead ;\r
+ var tbody = FCKDomTools.GetFirstChild( table, 'TBODY' ) ;\r
+\r
+ var previousFirstRow = tbody.firstChild ;\r
+ while ( tHead.firstChild )\r
+ {\r
+ var theRow = tHead.firstChild ;\r
+ for (var i = 0; i < theRow.childNodes.length ; i++ )\r
+ {\r
+ var newCell = RenameNode( theRow.childNodes[i], 'TD' ) ;\r
+ if ( newCell != null )\r
+ newCell.removeAttribute( 'scope' ) ;\r
+ }\r
+ tbody.insertBefore( theRow, previousFirstRow ) ;\r
+ }\r
+ table.removeChild( tHead ) ;\r
+ }\r
+\r
+ // Should we make all first cells in a row TH?\r
+ if ( (!hasColumnHeaders) && (headers=='col' || headers=='both') )\r
+ {\r
+ for( var row=0 ; row < table.rows.length ; row++ )\r
+ {\r
+ var newCell = RenameNode(table.rows[row].cells[0], 'TH') ;\r
+ if ( newCell != null )\r
+ newCell.scope = 'row' ;\r
+ }\r
+ }\r
+\r
+ // Should we make all first TH-cells in a row make TD? If 'yes' we do it the other way round :-)\r
+ if ( (hasColumnHeaders) && !(headers=='col' || headers=='both') )\r
+ {\r
+ for( var row=0 ; row < table.rows.length ; row++ )\r
+ {\r
+ var oRow = table.rows[row] ;\r
+ if ( oRow.parentNode.nodeName == 'TBODY' )\r
+ {\r
+ var newCell = RenameNode(oRow.cells[0], 'TD') ;\r
+ if (newCell != null)\r
+ newCell.removeAttribute( 'scope' ) ;\r
+ }\r
+ }\r
+ }\r