Is there a way to shrink the vertical space between two lines of text in table cells?
This can be achieved in following two ways:
1. Programmatically change the alignment of cell. Top cell's text should be aligned to bottom and bottom cell's alignment should be set to top. Please refer to section "5.6 - Customizing cells" in ServerReport Guide.
cell = table.getCell(1,0);
cell.setCellAlignment(JCPageTable.CELL_ALIGNMENT_BOTTOM);
cell = table.getCell(2,0);
cell.setCellAlignment(JCPageTable.CELL_ALIGNMENT_TOP);
This option can be used only if you are using java code. If you are using XML then only option is to use java-external-code tag to set this programmatically.
2. Put the text in one cell and use line-spacing attribute to reduce the gap. I have attached an example on this. Please take a look at a cell with red color text.
© ALL RIGHTS RESERVED. Feedback Terms of Use Privacy Cookie Preference Center