How to change width of single column of a table?

丶灬走出姿态 提交于 2020-01-05 09:28:56

问题


hello I have created table in PDF file using Itext library heading of my table columns are Medicine Name, Doses, time

My problem is: this is how my columns look like:

|Medicin|Doses|time|
| e name|     |    |

as you can see e falls in new line I have tried many things but cant figure out how to arrange my columns like :

|Medicine|Doses|time|
|  name  |     |    |

回答1:


The ColumnWidths example demonstrates different ways of changing the width of a column. This is one specific way:

PdfPTable table = new PdfPTable(3);
table.setWidths(new int[]{2, 1, 1});

Now the width of the first column is double the size of the second and third column. See the complete example for other ways to change the widths of columns.



来源:https://stackoverflow.com/questions/24141791/how-to-change-width-of-single-column-of-a-table

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!