Hi , I have two question:
1) How do I control the height of each row in a table to make it smaller? What I am trying to do is compress the table. There is too much room between line in the default table.setCellspacing(0) so I set it to table.setCellspacing(-2); Question, should I be doing this? Or is there another way? Table table = new Table(Constants.WIDTH_4); // 4 columns table.setWidth(Constants.WIDTH_TABLE); table.setWidths(Constants.widths_stnd_4); table.setOffset(0); table.setBorder(Rectangle.NO_BORDER); table.setDefaultCellBorder(Rectangle.NO_BORDER); table.setCellspacing(-2); 2) How do I control the vertical placement of the text in a cell? I cannot get the cell.setVerticalAlignment(Element.ALIGN_CENTER) to work. The text is right at the bottom so when I set the BackgroundColor things like "g" and "y" are cut off (the bottom part of the "g" and "y"). What can I do? table.addCell(""); Cell cell = new Cell(new Phrase(" " + RO.objectiveOutlook, Constants.SUB_TITLE_FONT)); cell.setBackgroundColor(new Color(Constants.HEADER_COLOR_1,Constants.HEADER_COLOR_2,Constants.HEADER_COL OR_3)); cell.setColspan(Constants.WIDTH_3); cell.setBorder(Rectangle.NO_BORDER); cell.setVerticalAlignment(Element.ALIGN_CENTER); table.addCell(cell); Thanks Ron |
- RE: [iText-questions] Table - Row Height Ronald Tooley
- RE: [iText-questions] Table - Row Height Paulo Soares