PgBiel / typst-tablex

More powerful and customizable tables in Typst
MIT License
370 stars 12 forks source link

Switch to native tables' fit auto columns algorithm #109

Closed PgBiel closed 8 months ago

PgBiel commented 8 months ago

Ensures maximum fairness by calculating the maximum fair share in order to shrink the smallest amount of columns possible.

Should lead to generally better-looking tables with auto columns, with cells having more space.

It was considered to add an option to keep the old algorithm (a toggle fit-auto-cols-algorithm: "greedy" | "fair", defaulting to "fair" (the new algorithm)), but that was decided against, since most tables should look largely the same after this change, and those which change should change for the better. (And one can always override the column sizes manually anyway.)

Before:

tablex shrank more columns and made them smaller than necessary, leading to overflowing content in cells when it could be avoided.

After:

tablex now fills the entire page width as is appropriate, leading to less overflowing content.