Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/haarcuba/cpp-text-table
C++ text table: format text in tabular form
https://github.com/haarcuba/cpp-text-table
Last synced: about 15 hours ago
JSON representation
C++ text table: format text in tabular form
- Host: GitHub
- URL: https://github.com/haarcuba/cpp-text-table
- Owner: haarcuba
- License: lgpl-2.1
- Created: 2016-04-30T17:57:13.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2021-11-04T19:12:10.000Z (about 3 years ago)
- Last Synced: 2023-11-07T19:56:31.571Z (about 1 year ago)
- Language: C++
- Homepage:
- Size: 39.1 KB
- Stars: 138
- Watchers: 9
- Forks: 36
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# C++ Text Table
Format text in tabular form: example:```C++
#include
#include "TextTable.h"main()
{
TextTable t( '-', '|', '+' );t.add( "" );
t.add( "Sex" );
t.add( "Age" );
t.endOfRow();t.add( "Moses" );
t.add( "male" );
t.add( "4556" );
t.endOfRow();t.add( "Jesus" );
t.add( "male" );
t.add( "2016" );
t.endOfRow();t.add( "Debora" );
t.add( "female" );
t.add( "3001" );
t.endOfRow();t.add( "Bob" );
t.add( "male" );
t.add( "25" );
t.endOfRow();t.setAlignment( 2, TextTable::Alignment::RIGHT );
std::cout << t;
return 0;
}
```will output:
+------+------+----+
| |Sex | Age|
+------+------+----+
|Moses |male |4556|
+------+------+----+
|Jesus |male |2016|
+------+------+----+
|Debora|female|3001|
+------+------+----+
|Bob |male | 25|
+------+------+----+