Bruno, thanks for answering.
I am using PdfPTable, sorry for being imprecise in the text. I also find your
suggestion logical, it was my first approach. Your suggestion would be:
PdfPTable testTable = new PdfPTable(2);
List list3 = new List(List.ORDERED, 20);
list3.Add("item1");
list3.Add("item2");
list3.Add("item3");
list3.Add("item4");
testTable.AddCell(list3);
This results in a compiler error:
Error 3 The best overloaded method match for
'iTextSharp.text.pdf.PdfPTable.AddCell(iTextSharp.text.pdf.PdfPCell)' has some
invalid arguments
Error 4 Argument '1': cannot convert from 'iTextSharp.text.List' to
'iTextSharp.text.pdf.PdfPCell'
I then saw an year old answer suggesting to add the list to a phrase first.
Btw, I assume you intended to write
testTable.AddCell(list3); and not testTable.AddCell(cell);
Lasse
-----Oprindelig meddelelse-----
Fra: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] På vegne af Bruno Lowagie
(iText)
Sendt: 15. maj 2007 12:12
Til: Post all your questions about iText here
Emne: Re: [iText-questions] Adding a List to a table cell renders as a single
line
Lars-Bo Jacobsen wrote:
> I use iTextSharp and would like to ad a List in a Phrase to a Table
> cell, but in the table it renders as a single line. Is there a way to
> achives my whises.
Why do you flatten the list by putting it inside a Phrase object???
> List list3 = new List(List.ORDERED, 20);
> list3.Add("item1");
> list3.Add("item2");
> list3.Add("item3");
> list3.Add("item4");
> Phrase phr3 = new Phrase();
> phr3.Add(list3);
Why not do 'the logical thing' and put the list inside a cell???
Table table = new Table(1);
List list = new List(List.ORDERED, 20);
list.add("item1");
list.add("item2");
list.add("item3");
list.add("item4");
table.addCell(cell);
Why not use PdfPTable instead of Table???
br,
Bruno
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/