Demonstrates the fix for https://github.com/p-ranav/tabulate/issues/107: shape() measures the *rendered* table (character width x line count), not the logical row/column count. dimensions() gives the latter.
| 6 | // shape() measures the *rendered* table (character width x line count), not |
| 7 | // the logical row/column count. dimensions() gives the latter. |
| 8 | int main() { |
| 9 | Table table; |
| 10 | table.add_row(Row_t{"cell"}); |
| 11 | |
| 12 | auto rendered = table.shape(); |
| 13 | std::cout << "shape() [rendered width x height]: (" << rendered.first << ", " << rendered.second |
| 14 | << ")\n"; |
| 15 | |
| 16 | auto logical = table.dimensions(); |
| 17 | std::cout << "dimensions() [rows x columns]: (" << logical.first << ", " << logical.second << ")" |
| 18 | << std::endl; |
| 19 | } |
nothing calls this directly
no test coverage detected