这是indexloc提供的服务,不要输入任何密码
Skip to content

Switch to native tables' fit auto columns algorithm #109

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 1, 2024

Conversation

PgBiel
Copy link
Owner

@PgBiel PgBiel commented Jan 1, 2024

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.

Ensures maximum fairness by calculating the maximum fair share to shrink
the smallest amount of columns possible.
@PgBiel PgBiel added table-parity auto track sizing Related to calculation of the size of an auto column/row. labels Jan 1, 2024
@PgBiel PgBiel added this to the v0.0.8 milestone Jan 1, 2024
@PgBiel PgBiel self-assigned this Jan 1, 2024
@PgBiel PgBiel merged commit 8a76b6c into 0.1.0-dev Jan 1, 2024
@PgBiel PgBiel deleted the new-fit-auto-cols-algo branch January 1, 2024 01:12
PgBiel added a commit that referenced this pull request Jan 1, 2024
Switch to native tables' fit auto columns algorithm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto track sizing Related to calculation of the size of an auto column/row. table-parity
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant