Output in a table format in Java's System.out

前端 未结 8 1420
清歌不尽
清歌不尽 2020-11-22 15:03

I\'m getting results from a database and want to output the data as a table in Java\'s standard output

I\'ve tried using \\t but the first column I want is very vari

8条回答
  •  Happy的楠姐
    2020-11-22 15:35

    Check this out. The author provides a simple but elegant solution which doesn't require any 3rd party library. http://www.ksmpartners.com/2013/08/nicely-formatted-tabular-output-in-java/

    An example of the TableBuilder and sample output

提交回复
热议问题