List of dicts formatting
I noticed an issue with the formatting of a list of dict, as show by the sample statements above.
x = [dict(x=1, y=2), dict(x=3, y=4)]
print(tabulate(x, headers='keys', tablefmt='pipe'))
| 0 | 1 | |:----|:----| | x | y | | x | y |
print(tabulate(x, headers='firstrow', tablefmt='pipe'))
Result (the header is correct, but the contents are not):
| x | y | |:----|:----| | x | y |
The only way I can get tabulate to print the correct output is by doing as follows:
tabulate([item.values() for item in x], tablefmt='pipe', headers=x.keys())
| x | y | |----:|----:| | 1 | 2 | | 3 | 4 |
However, I know that this last statement might generate output where the headers and contents don't match (issue 23).