在Java的System.out中以表格式输出我从数据库中获得结果,并希望将数据作为Java标准输出中的表输出我尝试使用\t,但是我想要的第一列的长度是非常可变的。有没有一种方法可以在像输出这样好的表中显示这一点?
3 回答

大话西游666
TA贡献1817条经验 获得超14个赞
System.out.format
System.out.format("%32s%10d%16s", string1, int1, string2);
string1
, int1
string2
java.util.Formatter
System.out.format
Formatter

慕婉清6462132
TA贡献1804条经验 获得超2个赞
TextTable tt = new TextTable(columnNames, data); tt.printTable();
添加回答
举报
0/150
提交
取消