我要尋找一個類似圖書館prettytable但在C++漂亮的打印表在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);
相關:http://stackoverflow.com/questions/2950639/printing-2d-table-headers/2950851#2950851 – Inverse 2010-12-17 20:06:43