Closed deeplook closed 2 years ago
Hi @deeplook, the world is so small :smile:
Unfortunately, the export
API for ReST doesn't support any column widths argument currently.
However, you should be able to workaround this way:
from tablib.formats import registry
rst = registry.get_format('rst')
data = ...<prepare your data>...
rst.export_set_as_grid_table(data, column_widths=[12, 22, ...])
Does this suit your use case?
😄
Yes, this would be much better. I could even do without the grid entirely, like a CSV with some max. column widths... I mean, it would be a few lines only to do without another package. 😄
Not sure, do you expect anything more from this ticket?
I think it's ok. I have my own little function doing it. Providing generic params for alignment and column widths (incl. wrapping) might be worth to think of as feature for formats where it makes sense. Otherwise I'm fine with closing this. Thanks!
I'm looking for some way to output tables without wrapping cell content like in the attached example, but I can't see an option for it. Is there a way or a workaround?