c.col = cn;
}
- if (typeof(this.colWidths[cn]) == 'undefined') {
+ if (typeof(this.colWidths[cn]) == 'undefined' && c.colspan < 2) {
this.colWidths[cn] = ce.style.width;
if (this.colWidths[cn] != '') {
all_auto = false;
mergeRight: function()
{
- console.log("htmleditor.BlockTd mergeRight");
// get the contents of the next cell along..
var tr = this.node.closest('tr');
if (r == cd.row && c == cd.col) {
this.node.removeAttribute('rowspan');
this.node.removeAttribute('colspan');
- continue;
}
var ntd = this.node.cloneNode(); // which col/row should be 0..
- ntd.removeAttribute('id'); //
- //ntd.style.width = '';
+ ntd.removeAttribute('id');
+ ntd.style.width = this.colWidths[c];
ntd.innerHTML = '';
table[r][c] = { cell : ntd, col : c, row: r , colspan : 1 , rowspan : 1 };
}
}
this.redrawAllCells(table);
-
-
},
},
updateWidths : function(table)
{
- console.log("htmleditor.BlockTd updateWidths");
- console.log("TABLE");
- console.log(table);
- console.log("COLWIDTH");
- console.log(this.colWidths);
for(var r = 0 ; r < table.length; r++) {
for(var c = 0 ; c < table[r].length; c++) {
}
if (this.colWidths[0] != false && table[r][c].colspan < 2) {
- console.log("CELL");
- console.log(table[r][c].cell);
var el = Roo.htmleditor.Block.factory(table[r][c].cell);
el.width = Math.floor(this.colWidths[c]) +'%';
el.updateElement(el.node);
}
- else {
- console.log("CELL COLSPAN");
- console.log(table[r][c]);
+ if (this.colWidths[0] != false && table[r][c].colspan > 1) {
+ var el = Roo.htmleditor.Block.factory(table[r][c].cell);
+ var width = 0;
+ for(var i = 0; i < table[r][c].colspan; i ++) {
+ width += Math.floor(this.colWidths[c + i]);
+ }
+ el.width = width +'%';
+ el.updateElement(el.node);
}
table[r][c].cell = false; // done
}
},
normalizeWidths : function(table)
{
-
if (this.colWidths[0] === false) {
var nw = 100.0 / this.colWidths.length;
this.colWidths.forEach(function(w,i) {