我正在寻找一个与prettytable类似的C++库。
http://code.google.com/p/prettytable/
我知道如何使用printf或iostream自己生成表格。但是,我想知道是否有类似的库。
我只对将ASCII表格输出到控制台感兴趣。
最好是像这样的:
std::vector<std::string> headers;
headers.push_back("My Awesome Header 1");
headers.push_back("My Awesome Header 2");
headers.push_back("My Awesome Header 3");
PrettyTablePrinter ptp;
ptp.SetHeaders(headers);
// Set some other options here
ptp.AddRow(data[0]);
ptp.AddRow(data[1]);
ptp.AddRow(data[2]);
ptp.Print(&std::cout);