private void readTable() { TableRow[] rows = getRows(); int[] columnsRequired = new int[ rows.length ]; for (int i = 0; i < rows.length; i++) { TableCell[] cells = rows[i].getCells(); for (int j = 0; j < cells.length; j++) { int spannedRows = Math.min( columnsRequired.length-i, cells[j].getRowSpan() ); for (int k = 0; k < spannedRows; k++) { columnsRequired[ i+k ]+= cells[j].getColSpan(); } } } int numColumns = 0; for (int i = 0; i < columnsRequired.length; i++) { numColumns = Math.max( numColumns, columnsRequired[i] ); } _cells = new TableCell[ columnsRequired.length ][ numColumns ]; for (int i = 0; i < rows.length; i++) { TableCell[] cells = rows[i].getCells(); for (int j = 0; j < cells.length; j++) { int spannedRows = Math.min( columnsRequired.length-i, cells[j].getRowSpan() ); for (int k = 0; k < spannedRows; k++) { for (int l = 0; l < cells[j].getColSpan(); l++) { placeCell( i+k, j+l, cells[j] ); } } } } }
private void readTable() { TableRow[] rows = getRows(); int[] columnsRequired = new int[ rows.length ]; for (int i = 0; i < rows.length; i++) { TableCell[] cells = rows[i].getCells(); for (int j = 0; j < cells.length; j++) { int spannedRows = Math.min( columnsRequired.length-i, cells[j].getRowSpan() ); for (int k = 0; k < spannedRows; k++) { columnsRequired[ i+k ]+= cells[j].getColSpan(); } } } int numColumns = 0; for (int i = 0; i < columnsRequired.length; i++) { numColumns = Math.max( numColumns, columnsRequired[i] ); } _cells = new TableCell[ columnsRequired.length ][ numColumns ]; for (int i = 0; i < rows.length; i++) { TableCell[] cells = rows[i].getCells(); for (int j = 0; j < cells.length; j++) { int spannedRows = Math.min( columnsRequired.length-i, cells[j].getRowSpan() ); for (int k = 0; k < spannedRows; k++) { for (int l = 0; l < cells[j].getColSpan(); l++) { placeCell( i+k, j+l, cells[j] ); } } } } }
private void readTable() { TableRow[] rows = getRows(); int[] columnsRequired = new int[ rows.length ]; for (int i = 0; i < rows.length; i++) { TableCell[] cells = rows[i].getCells(); for (int j = 0; j < cells.length; j++) { int spannedRows = Math.min( columnsRequired.length-i, cells[j].getRowSpan() ); for (int k = 0; k < spannedRows; k++) { columnsRequired[ i+k ]+= cells[j].getColSpan(); } } } int numColumns = 0; for (int i = 0; i < columnsRequired.length; i++) { numColumns = Math.max( numColumns, columnsRequired[i] ); } _cells = new TableCell[ columnsRequired.length ][ numColumns ]; for (int i = 0; i < rows.length; i++) { TableCell[] cells = rows[i].getCells(); for (int j = 0; j < cells.length; j++) { int spannedRows = Math.min( columnsRequired.length-i, cells[j].getRowSpan() ); for (int k = 0; k < spannedRows; k++) { for (int l = 0; l < cells[j].getColSpan(); l++) { placeCell( i+k, j+l, cells[j] ); } } } } }
for (int col = 0; col < columnHasText.length; col++) { if (getCellAsText(row,col).trim().length() == 0) continue; if (getTableCell(row,col).getColSpan() == 1 && getTableCell(row,col).getRowSpan() == 1) { if (!rowHasText[row]) numRowsWithText++; if (!columnHasText[col]) numColumnsWithText++; boolean neededInRow = true; boolean neededInCol = true; for (int i = coords[0]; neededInRow && (i < rowHasText.length) && (i < coords[0] + cell.getRowSpan()); i++) { neededInRow = !rowHasText[i];
for (int col = 0; col < columnHasText.length; col++) { if (getCellAsText(row,col).trim().length() == 0) continue; if (getTableCell(row,col).getColSpan() == 1 && getTableCell(row,col).getRowSpan() == 1) { if (!rowHasText[row]) numRowsWithText++; if (!columnHasText[col]) numColumnsWithText++; boolean neededInRow = true; boolean neededInCol = true; for (int i = coords[0]; neededInRow && (i < rowHasText.length) && (i < coords[0] + cell.getRowSpan()); i++) { neededInRow = !rowHasText[i];
for (int col = 0; col < columnHasText.length; col++) { if (getCellAsText(row,col).trim().length() == 0) continue; if (getTableCell(row,col).getColSpan() == 1 && getTableCell(row,col).getRowSpan() == 1) { if (!rowHasText[row]) numRowsWithText++; if (!columnHasText[col]) numColumnsWithText++; boolean neededInRow = true; boolean neededInCol = true; for (int i = coords[0]; neededInRow && (i < rowHasText.length) && (i < coords[0] + cell.getRowSpan()); i++) { neededInRow = !rowHasText[i];