如何更改表的单列的宽度是多少? [英] How to change width of single column of a table?

查看:179
本文介绍了如何更改表的单列的宽度是多少?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在使用我的表中的列iText库标题PDF文件你好我已经创建的表是医学名称,剂量,时间

我的问题是:
这是我的专栏什么样子:

  | Medicin |剂量|时间|
| Ë名称| | |

你可以看到ê落在新行我已经试过很多东西,但无法弄清楚如何安排像我列:

  |医药|剂量|时间|
|名称| | |


解决方案

借助列宽示例演示更改列的宽度不同的方式。这是一个特定的方式:

  PdfPTable表=新PdfPTable(3);
table.setWidths(新INT [] {2,1,1});

现在第一列的宽度是第二和第三列的两倍。请参见完整的示例其他方式来改变列的宽度的。

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  |     |    |

解决方案

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.

这篇关于如何更改表的单列的宽度是多少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆