Documentation missing for using a dictionary as the header for a list of dictionaries
When using tabulate with a list of dictionaries, it gives an error if the header is not a keyword or a dictionary. There is documentation for the keyword options but nothing for the dictionary as header option.
A short explanation and an example would be very helpful e.g.:
When tabulating a list of dictionaries, a dictionary can be used to replace the labels for keys in your list of dictionaries - for example:
samplelistdict=[ { "key1" : "value1", "key2": "value2" },{ "key1" : "value11", "key2": "value12" } ]
sampleheaderdict={"key1": "Bettername", "key2": "Better2"}
print(tabulate(samplelistdict, sampleheaderdict))
Produces:
Bettername Better2
------------ ---------
value1 value2
value11 value12
When this feature is documented, it may be useful to suggest use of the ordered dictionaries. Using an ordinary dictionary for headers or data confuses some users when they don't see columns in the same order they expected them to be seen.
Actually, python preserves the insertion order of dictionaries since 3.7 (officially) so they are safe to use now.
This means the example in README about using keys in headers should be changed since the column labels are swapped there which should no longer happen.
I did this in the same PR which fixes the current issue.