这对我来说效果很好:http ://code.google.com/p/java-ascii-table/
String [] header = {
"User Name",
"Salary", "Designation",
"Address", "Lucky#"
};
String[][] data = {
{ "Ram", "2000", "Manager", "#99, Silk board", "1111" },
{ "Sri", "12000", "Developer", "BTM Layout", "22222" },
{ "Prasad", "42000", "Lead", "#66, Viaya Bank Layout", "333333" },
{ "Anu", "132000", "QA", "#22, Vizag", "4444444" },
{ "Sai", "62000", "Developer", "#3-3, Kakinada" },
{ "Venkat", "2000", "Manager" },
{ "Raj", "62000"},
{ "BTC"},
};
呈现以下内容:
+-----------+--------+-------------+-------------- ----------+---------+
| 用户名 | 工资 | 名称 | 地址 | 幸运# |
+-----------+--------+-------------+-------------- ----------+---------+
| 拉姆 | 2000 | 经理 | #99,丝绸板 | 1111 |
| 斯里兰卡 | 12000 | 开发商 | BTM 布局 | 22222 |
| 普拉萨德 | 42000 | 铅 | #66,维亚亚银行布局| 333333 |
| 阿努 | 132000 | 质量保证 | #22,维扎格 | 4444444 |
| 赛 | 62000 | 开发商 | #3-3, Kakinada | |
| 文卡特 | 2000 | 经理 | | |
| 拉吉 | 62000 | | | |
| 比特币 | | | | |
+-----------+--------+-------------+-------------- ----------+---------+