| 676 | // Check for identical columns in tableMap, |
| 677 | // to remove them to get a proper colspan. |
| 678 | var doubleCol = new Array() ; |
| 679 | for ( var i = 0 ; i < tableMap.length ; i++ ) |
| 680 | { |
| 681 | for ( var j = 0; j < tableMap[i].length ; j++ ) |
| 682 | { |
| 683 | // When doubleCol[j] == 0 the previous column is definitly not identical to the current one |
| 684 | if( doubleCol[j] == 0 ) |
| 685 | continue ; |
| 686 | else if ( tableMap[i][j-1] && tableMap[i][j-1] == tableMap[i][j] ) |
| 687 | doubleCol[j] = 1 ; |
| 688 | else |
| 689 | doubleCol[j] = 0 ; |
| 690 | } |
| 691 | } |
| 692 | |
| 693 | // Build a temporary newTableMap. |
| 694 | var newTableMap = new Array() ; |
| 695 | for ( var i = 0 ; i < tableMap.length ; i++ ) |
| 696 | { |
| 697 | var newRow = new Array() ; |
| 698 | for ( var j = 0; j < tableMap[i].length ; j++ ) |
| 699 | { |
| 700 | // Only insert the cell into newTableMap if the previous column is not identical to the current one. |
| 701 | if( doubleCol[j] == 0 ) |
| 702 | newRow.push( tableMap[i][j] ) ; |
| 703 | } |
| 704 | newTableMap.push( newRow ) ; |
| 705 | } |
| 706 | |
| 707 | // Replace tableMap with the temporary newTableMap. |
| 708 | tableMap = newTableMap ; |
| 709 | |