Pretty print a table in C++

前端 未结 8 1049
眼角桃花
眼角桃花 2020-12-28 09:25

I am looking for a library similar to prettytable but in C++

http://code.google.com/p/prettytable/

I know how to generate one myself using either printf or i

8条回答
  •  佛祖请我去吃肉
    2020-12-28 09:55

    To my knowledge, you have three major options here :

    • A "C way" through the use of printf with width specifiers
    • A "C++ way" through the use of stream manipulators (in particular std::setw and std::setfill)
    • An intermediate way using Boost.Format which allow you to use printf style formatters with streams.

    I'm not aware of any library which could help you in the "table design" more than this.

提交回复
热议问题