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

support horizontal rule #27

Open
garfieldnate opened this issue Apr 12, 2021 · 2 comments
Open

support horizontal rule #27

garfieldnate opened this issue Apr 12, 2021 · 2 comments

Comments

@garfieldnate
Copy link

In the tables I'm generating, I have several sections. It would useful to be able to add a separator between these sections.

@JakeWharton
Copy link
Owner

And you don't want to use separate tables because you want all of their columns to align?

Do you have an example output that you think would make sense so I can get an idea of what you mean exactly?

@garfieldnate
Copy link
Author

Yep, I'd like all of the columns to align. The context is that I'm porting a Perl project to Java. Here's the printout I have from the Perl module: https://metacpan.org/source/NGLENN/Algorithm-AM-3.11/t%2F04-Result.t#L223; the *** lines are rules (I use https://metacpan.org/pod/Text::Table, which provides a rule method). I know this one is ugly; I think Picnic can do better using the unicode box drawing characters, since there are already characters available for double lines or, probably a better choice, bold lines (U+251D, etc.).

My current printout with picnic is as follows:

┌────────────┬──────────┬───────────┬───────┬─────────┐
│ Percentage │ Pointers │ Num Items │ Class │ Context │
├────────────┼──────────┼───────────┼───────┼─────────┤
│    %61.538 │        8 │         2 │       │   3 1 * │
├────────────┼──────────┼───────────┼───────┼─────────┤
│    %30.769 │        4 │         1 │     e │         │
│            │          │           │       │   3 1 0 │
│    %30.769 │        4 │         1 │     r │         │
│            │          │           │       │   3 1 1 │
├────────────┼──────────┼───────────┼───────┼─────────┤
│    %23.077 │        3 │         1 │       │   * 1 2 │
├────────────┼──────────┼───────────┼───────┼─────────┤
│    %23.077 │        3 │         1 │     r │         │
│            │          │           │       │   2 1 2 │
├────────────┼──────────┼───────────┼───────┼─────────┤
│    %15.385 │        2 │         1 │       │   * * 2 │
├────────────┼──────────┼───────────┼───────┼─────────┤
│    %15.385 │        2 │         1 │     r │         │
│            │          │           │       │   0 3 2 │
└────────────┴──────────┴───────────┴───────┴─────────┘

The rows with 3 1 *, * 1 2 and * * 2 in the Context column are meant to start their own sections in the table.

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

No branches or pull requests

2 participants