Format output in a table, C++

前端 未结 4 1555
春和景丽
春和景丽 2020-12-09 20:30

How can I output data to the console in a table in C++? There\'s a question for this in C#, but I need it in C++.

This, except in C++: How To: Best way to draw table

4条回答
  •  悲&欢浪女
    2020-12-09 21:10

    I couldn't find something I liked, so I made one. Find it at https://github.com/haarcuba/text-table

    Here's an exmaple of its output:

    +------+------+----+
    |      |Sex   | Age|
    +------+------+----+
    |Moses |male  |4556|
    +------+------+----+
    |Jesus |male  |2016|
    +------+------+----+
    |Debora|female|3001|
    +------+------+----+
    |Bob   |male  |  25|
    +------+------+----+
    

提交回复
热议问题