/* *###################################### * eWebEditor v4.00 - Advanced online web based WYSIWYG HTML editor. * Copyright (c) 2003-2007 eWebSoft.com * * For further information go to http://www.ewebsoft.com/ * This copyright notice MUST stay intact for use. *###################################### */ var selectedTD var selectedTR var selectedTBODY var selectedTable function TableInsert(){ if (!isTableSelected()){ showDialog('table.htm', true); } } function TableProp(){ if (isTableSelected()||isCursorInTableCell()){ showDialog('table.htm?action=modify', true); } } function TableCellProp(){ if (isCursorInTableCell()){ showDialog('tablecell.htm', true); } } function TableCellSplit(){ if (isCursorInTableCell()){ showDialog('tablecellsplit.htm',true); } } function TableRowProp(){ if (isCursorInTableCell()){ showDialog('tablecell.htm?action=row', true); } } function TableRowInsertAbove() { if (isCursorInTableCell()){ var numCols = 0 allCells = selectedTR.cells for (var i=0;i1 while (selectedTD.rowSpan > 1 && addRowsNoSpan > 0){ var nextRow = allRows[selectedTR.rowIndex+selectedTD.rowSpan-1]; selectedTD.rowSpan -= 1; var ncLeftColSpan = 0; var position = -1; for (var n=0; nnsLeftColSpan){ position = n; break; } } var newTD=nextRow.insertCell(position); newTD.innerHTML = " "; if (borderShown == "yes") { newTD.runtimeStyle.border = "1px dotted #BFBFBF"; } addRowsNoSpan -= 1; } // rowspan=1 for (var n=0; n1)&&(allRows[j].cells[k].rowSpan>=selectedTR.rowIndex-allRows[j].rowIndex+1)){ allRows[j].cells[k].rowSpan += 1; } } } for (i = 0; i < allCells.length; i++) { if (i!=selectedTD.cellIndex){ selectedTR.cells[i].rowSpan += 1; }else{ newTD = newTR.insertCell(); newTD.colSpan = selectedTD.colSpan; newTD.innerHTML = " "; if (borderShown == "yes") { newTD.runtimeStyle.border = "1px dotted #BFBFBF"; } } } } } function TableRowDelete() { if (isCursorInTableCell()) { selectedTable.deleteRow(selectedTR.rowIndex) } } function TableColInsertLeft() { if (isCursorInTableCell()) { moveFromEnd = (selectedTR.cells.length-1) - (selectedTD.cellIndex) allRows = selectedTable.rows for (i=0;i 1) { allCellsInRow[position].colSpan = allCellsInRow[position].colSpan - 1 } else { allRows[i].deleteCell(position) } } } } function TableColSplit(nCols){ if (!isCursorInTableCell()) return; if (nCols<2) return; var addCols = nCols - 1; var addColsNoSpan = addCols; var newCell; var nsLeftColSpan = 0; var nsLeftRowSpanMoreOne = 0; for (var i=0; i 1){ nsLeftRowSpanMoreOne += 1; } } var allRows = selectedTable.rows // colSpan>1 while (selectedTD.colSpan > 1 && addColsNoSpan > 0) { newCell = selectedTR.insertCell(selectedTD.cellIndex+1); newCell.innerHTML = " " if (borderShown == "yes") { newCell.runtimeStyle.border = "1px dotted #BFBFBF" } selectedTD.colSpan -= 1; addColsNoSpan -= 1; } // colSpan=1 for (i=0;insLeftColSpan){ position = n; break; } } if (selectedTR.rowIndex!=i){ if (position!=-1){ allRows[i].cells[position+nsLeftRowSpanMoreOne].colSpan += addColsNoSpan; } }else{ for (var n=0; n