aspose file tools*
The moose likes Other Open Source Projects and the fly likes How to set the cell size with PdfPCell object in the table? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "How to set the cell size with PdfPCell object in the table?" Watch "How to set the cell size with PdfPCell object in the table?" New topic
Author

How to set the cell size with PdfPCell object in the table?

Simpson Kumar
Ranch Hand

Joined: Mar 19, 2008
Posts: 261
Hi,

I would like to set the size to the cell like in HTML as follows


In my PDF code, we used the following code to set the cell for the table


I didn't find any method to set the size of the cell.
please some one give me the suggestion on this.


Thanks,
Kumar
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42614
    
  65
You can't change the width of individual cells, only of a complete column. The PdfPtable class has the setWidths method for that, or you can use the PdfPTable(float[] relativeWidths) constructor.


Ping & DNS - my free Android networking tools app
Simpson Kumar
Ranch Hand

Joined: Mar 19, 2008
Posts: 261
so, in the Java PDF we can't set the size to the cells, i.e. if the table width is 600 like , then the three cells equally shares the size? I think it doesn't make sence.. but I need to maintain three cells in different sizes as I mentioned in the query. what can I do?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42614
    
  65
The two methods I mentioned let you set different widths for each column, while setTotalWidth sets the width of the table itself. Why do you think that doesn't make sense?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to set the cell size with PdfPCell object in the table?