Itextsharp RowSpan missing? no definition for rowspan
See this forum question discussing the different iTextSharp versions. It should work in the latest iTextsharp version.
Rowspan with iTextSharp doesn't work properly
Well the basic answer is: it works! if you add two more cells, you will see that one cell (the one underneath A) is not filled.
But this is not what you expect (nor did I btw). To achive what you want use nested tables, that means:
- create a table with two cols
- insert cell A into table
- create cell 2
- create one more table with 1 col
- insert cell B into table 2
- insert cell c into table 2
- insert table 2 into cell 2
search for itext rowspan, you will find multiple fully typed out examples.
hth
Mario
itextsharp: rowspan doesn't work
Your cell "Riepilogo missioni valori dal " only spans 13 columns. PdfPTable requires that you fill in the rest of those columns (4) at the end of your current row before it will jump to the next row of 17 columns.
To fill in the end of your row, you can either add 4 empty cells or use the CompleteRow method.
table.AddCell("")
table.AddCell("")
table.AddCell("")
table.AddCell("")
or
table.CompleteRow()
iText: Cell with Image doesn't apply Rowspan
In case you wonder why nobody is answering your question. That's simple: the problem you describe can not be reproduced. I have taken your code snippet, and I have created the following standalone example:
PdfPTable table = new PdfPTable(2);
PdfPCell imageCell = new PdfPCell();
imageCell.addElement(Image.getInstance(IMG));
imageCell.setRowspan(2);
table.addCell(imageCell);
table.addCell(new Phrase("1"));
table.addCell(new Phrase("2"));
For the full source code, see ImageRowspan
The resulting PDF looks like this:
As you can see, the table has two columns and two rows. The first cell (the one with the image) spans two rows. You can download cmp_image_rowspan.pdf from out git repository.
Related Topics
Uploadfile with Post Values by Webclient
How to Display Formatted Code in Webpage
Arkit Body Tracking Using Xamarin and C# Inaccurate
Extending an Enum via Inheritance
Best Way to Tackle Global Hotkey Processing in C#
Webclient.Downloadstring() Returns String with Peculiar Characters
Reflection - Getting the Generic Arguments from a System.Type Instance
How to Upload Files in ASP.NET Core
C# Sha-1 VS. PHP Sha-1...Different Results
Remove CSS Class in Code Behind
How to Call Code Behind Server Method from a Client Side JavaScript Function
Difference Between Namespace in C# and Package in Java
Namespace' But Is Used Like a 'Type'