i am trying to do a rowspan in one cell but it won’t work.
Is it a bug or is my code wrong?
Cell cell11 = new Cell(table, “some text”);
Cell cell12 = new Cell(table,“some more text”);
//add another row
Row row2 = new Row(table);
Cell cell21 = new Cell(table,“another some text”);
Cell cell22 = new Cell(table,“another some more text”);
//add table to sec1
thanks for help
I’m sorry,setRowSpan method is not supported in Cell class. We add this method to keep the identical interface with the Cell in .net. You can use NestedTable to get the same effect with setRowSpan. In that way, your code can be rewritten as follows:
Cell cell11 = new Cell(table, “some text”); //cell11.setPadding( new MarginInfo(10, 0, 0, 0)); Row row1 = table.getRows().add(); row1.getCells().add(cell11); Cell cell12 = new Cell(table); row1.getCells().add(cell12); Table table2 = new Table(cell12); table2.getRows().add().getCells().add(“some more text”); table2.getRows().add().getCells().add(“another some more text”); cell12.addNestedTable(table2);
You can also use the setPadding method to adjust the position of the content (like the code which has been commented).
Hopefully, this will help, thank you for your advice.
Thanks for help,
i did another workaround i put emtpy cells into the table.
my customer didn’t like my workaround with empty cells for the rowspan.
Could you please support the rowspan in the aspose java pdf?
This function is very difficult to implement. We will not support this issue in the next release. We will support this function in the future, but we don’t know when we will provide this function.
Thank you for using our product.
anything new about this issue?
We recently have released a version of Aspose.Pdf for Java 2.6.0 which includes the method Cell.setRowSpan(..); which can serve your purpose. Please try using this version and in case you face any problem or you have any further query, please feel free to contact.
You can download Aspose.Pdf for Java 2.6.0 from here.