voilab/voilab-pdf-table

auto grow all columns?

yocontra opened this issue · 2 comments

is this possible? i've tried it by adding the fitcolumn plugin for each column but it ends up laying out really bad. i think this is a super common use case - i just want to render data in a table, i don't care how wide anything is because the width will vary depending on what i render. if i have one column that has super long values and one with some small values it would handle that nicely.

tafel commented

What is problematic here is that you need to know the width of all your cells first, then calculate a ratio to determine width for each column.

The goal of this lib is to provide a quick way to draw data in a table. Predefined widths is a lot more optimized than calculating by parsing everything.

If you find a decent way to do that, please create a new PR, so we can discuss that here and see what is possible.

@tafel Luckily you can only fit so many rows on a page, and if you draw each page one at a time you could quite easily buffer a page worth of rows, compute the sizes, then render the page. Just a thought - if out of scope for this library feel free to close this issue.