Those are two different universes. If you are using Document.add(table) then what counts is setWidthPercentage(). If you are placing the table at a precise position with writeSelectedRows() then it's setTotalWidth() that counts. It feels strange because you are using the first option.
Best Regards, Paulo Soares > -----Original Message----- > From: Joel Matos [SMTP:[EMAIL PROTECTED] > Sent: Thursday, March 13, 2003 13:26 > To: [EMAIL PROTECTED] > Cc: [EMAIL PROTECTED] > Subject: Re: RE: [iText-questions] pdftable > > It isn't working... > I do this: > > datatable.setWidths(myWidths); > datatable.setTotalWidth(totalWidths); > > But even if i set absurd values, i always get the same layout that is a > table that fits perfectly in the > page, and it's smaller than if i set > > datatable.setWidthPercentage(100); > > It looks like setTotalWidths sets my value as a relative value of 100% and > then sets column widths with the > relative value to totalwidth > Even if i set a value for totalWidth that is smaller than the sum of all > column widths i get the same > result... > So setTotalWidth doesn't afect the table size at all and i can't get a > table that is bigger than the page... > Unless i do something like this: > > datatable.setWidthPercentage(300); > > So what i have to do is something like this: > > Take X as the page width in points (842) and use it as 100% > Take Y as my totalwidth in points and get the relative value in percentage > to X. > And then use setWidthPercentage() > > x = 842; > y = mytotal / 842 * 100; > datatable.setWidthPercentage(Y) > > > It seems to work but it's a strange solution... > > Thanks for your time > Joel > > > [EMAIL PROTECTED] writes: > :It's a matter of arithmetic setting the right column size from > :setTotalWidth(). I'm tempted to add a method to PdfPTable to do the > :calculation. The last version allows the table to split if it's very wide > :so, you can keep the other table half. > : > :Best Regards, > :Paulo Soares > : > :> -----Original Message----- > :> From: Joel Matos [SMTP:[EMAIL PROTECTED] > :> Sent: Thursday, March 13, 2003 11:49 > :> To: [EMAIL PROTECTED] > :> Subject: [iText-questions] pdftable > :> > :> Hi! > :> I'm having some problens seting column widths... > :> Can i set absolute values, even if it causes the table to loose some > :> columns? > :> Like for example i have a report on the browser and user sets column > :> widths in pixels... > :> I want those columns in the pdftable to have user values even if only > half > :> of the table is printed! > :> Thanks for your help! > :> Joel. > :> > :> > :> > :> ------------------------------------------------------- > :> This SF.net email is sponsored by:Crypto Challenge is now open! > :> Get cracking and register here for some mind boggling fun and > :> the chance of winning an Apple iPod: > :> http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en > :> _______________________________________________ > :> iText-questions mailing list > :> [EMAIL PROTECTED] > :> https://lists.sourceforge.net/lists/listinfo/itext-questions > : > : > :------------------------------------------------------- > :This SF.net email is sponsored by:Crypto Challenge is now open! > :Get cracking and register here for some mind boggling fun and > :the chance of winning an Apple iPod: > :http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en > :_______________________________________________ > :iText-questions mailing list > :[EMAIL PROTECTED] > :https://lists.sourceforge.net/lists/listinfo/itext-questions > ------------------------------------------------------- This SF.net email is sponsored by:Crypto Challenge is now open! Get cracking and register here for some mind boggling fun and the chance of winning an Apple iPod: http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en _______________________________________________ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions