Skip to content
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

[Feature Request] option to control width gestimation of tables. #10433

Open
terefang opened this issue Dec 3, 2024 · 9 comments
Open

[Feature Request] option to control width gestimation of tables. #10433

terefang opened this issue Dec 3, 2024 · 9 comments

Comments

@terefang
Copy link

terefang commented Dec 3, 2024

today simple_tables and pipe_tables as well as HTML-Tables are subject to an automatic mechanism gestimating their column widths by various means.

there are various usecases that either want gestimation to be performed always or never.

for the sake of continuity also the current behaviour should be preserved most likely as the default.

Describe your proposed improvement and the problem it solves.

the proposal is to have an option called --smart-table-widths that take the following parameters:

  • "auto" being the behavior as it is now, should be the default.
  • "off" never compute them as for @sphakka case (above).
  • "on" always compute them as for my case.(above).

in my "always" case the gestimated widths become available to lua-filters and the typst target to ensure proper layout regardless of table and column sizes.

in @sphakka "never" case the gestimated widths are discarded in favor of the reflow capabilities of the HTML/CSS target.

@jgm
Copy link
Owner

jgm commented Dec 3, 2024

I believe that only pipe_tables is subject to this. Simple tables never have widths calculated; multiline tables and grid tables always hav them. So this only affects pipe tables.

@jgm
Copy link
Owner

jgm commented Dec 3, 2024

Accordingly, the option, if there is one, should be --pipe-table-widths=smart|always|never.

@terefang
Copy link
Author

terefang commented Dec 4, 2024

the option naming sounds reasonable to me.

@bpj
Copy link

bpj commented Dec 5, 2024

see #10427 (comment)

@Mathnerd314
Copy link

Not sure if this is actually related, but, as mentioned in the user guide there are "ugly" pipe tables, like:

fruit|price
---|---
apple|2.05
pear|1.37
orange|3.09

As an option I would like to have Pandoc output these "ugly" pipe tables, i.e. skip the width calculation, use three dashes for each column in the table header, and just output the pipe character or maybe pipe plus spaces like apple | 2.05 for each row.

@terefang
Copy link
Author

terefang commented Dec 6, 2024

if i see this correctly that would be the --pipe-table-widths=never case

@jgm
Copy link
Owner

jgm commented Dec 6, 2024

if i see this correctly that would be the --pipe-table-widths=never case.

No. The proposal above was for an option that affects parsing of tables, controlling whether width information is computed. The request above has to do with rendering. It is irrelevant to this issue.

@terefang
Copy link
Author

terefang commented Dec 6, 2024

ok ... sorry for my miss-interpretation

@Mathnerd314
Copy link

The request above has to do with rendering. It is irrelevant to this issue.

OK I opened #10453.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants