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


Win a copy of Java 8 in Action this week in the Java 8 forum!
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: 260
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: 39578
    
  27
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 - updated with new look and Ping home screen widget
Simpson Kumar
Ranch Hand

Joined: Mar 19, 2008
Posts: 260
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: 39578
    
  27
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?
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to set the cell size with PdfPCell object in the table?
 
Similar Threads
header overlapping with data in generated pdf document
iText PDF - Setting Page Magnification?
web dynpro application
How to increase the colum width
web dynpro application coding