Open dmoklaf opened 11 months ago
The problem is fixed with #221, but not yet released or pushed on PyPi. You'll need to install from source for now:
git clone https://github.com/astanin/python-tabulate.git
pip install ./python-tabulate
python
Tested in Python 3.11.5
>>> import tabulate
>>> print(tabulate.tabulate([], headers=['a', 'b', 'c', 'd', 'e'], colalign=['left', 'left', 'left', 'left', 'left']))
a b c d e
--- --- --- --- ---
Also, notice that #221 made your life simpler with the colglobalalign
keyword. Indeed:
>>> import tabulate
>>> print(tabulate.tabulate([], headers=['a', 'b', 'c', 'd', 'e'], colglobalalign='left'))
a b c d e
--- --- --- --- ---
Furthermore, you can now align headers differently from data (see help(tabulate.tabulate)
).
Cheers!
Outstanding work!
This crashes tabulate:
Removing the colalign argument resolves the crash, and tabulate outputs correctly an empty table. Adding data into the table also resolves the crash, and tabulate outputs correctly a table with that data.
Versions: tabulate 0.9.0 python 3.11.5 mamba 1.5.1 conda 23.7.4 macos 13.5.2