OpenPDF
OpenPDF copied to clipboard
HTMLWorker parseToList can not parse table with different tr html String
Describe the bug
if html String have a table with different rows.cells.size,will miss all row
To Reproduce
at IncCell.class,
line 104, PdfPTable table = new PdfPTable(ncol); ncol is cell number of first table row if i have a row is not such many cells, this row will be miss
- Sample Code
- Unit-Test
Expected behavior
Not given.
System
Not given
at IncTable.class , my fault
Normaly in a table, in a row, when you have less cells, than the table expects, you need to declare which cell has a larger colSpan. OpenPDF won't fill missing cells for you.
If you have some sample code, that could help finding your problem.
Normaly in a table, in a row, when you have less cells, than the table expects, you need to declare which cell has a larger colSpan. OpenPDF won't fill missing cells for you.
how should i do to declare which cell has a small colSpan,thanks
Take a look here: https://github.com/LibrePDF/OpenPDF/blob/master/pdf-toolbox/src/test/java/com/lowagie/examples/objects/tables/DefaultCell.java
Take a look here: https://github.com/LibrePDF/OpenPDF/blob/master/pdf-toolbox/src/test/java/com/lowagie/examples/objects/tables/DefaultCell.java
Thanks for your reply,in my project,i use method HTMLWorker.parseToList() to parse html String automatically, in this method, it is use first table column number to parse table,is there any method to replace this method or any other ways to make i can parse table with rows(with different column), Or how to use DefaultCell in this method ,thanks again!
Take a look at this example, maybe it can help you.
I'm not sure OpenPDF can do exactly what you want.