Map table topography
//console.log('mapRows'); // # of rows var rowCount = inRows.length; if(!rowCount){ return; } // map which columns and rows fill which cells this.map = [ ]; for(var j=0, row; (row=inRows[j]); j++){ this.map[j] = []; } for(var j=0, row; (row=inRows[j]); j++){ for(var i=0, x=0, cell, colSpan, rowSpan; (cell=row[i]); i++){ while (this.map[j][x]){x++}; this.map[j][x] = { c: i, r: j }; rowSpan = cell.rowSpan || 1; colSpan = cell.colSpan || 1; for(var y=0; y<rowSpan; y++){ for(var s=0; s<colSpan; s++){ this.map[j+y][x+s] = this.map[j][x]; } } x += colSpan; } } //this.dumMap();