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

multi-line header titles #5

Open
Ramblurr opened this issue Mar 5, 2022 · 0 comments
Open

multi-line header titles #5

Ramblurr opened this issue Mar 5, 2022 · 0 comments

Comments

@Ramblurr
Copy link

Ramblurr commented Mar 5, 2022

In some cases when the contents of a header is much longer than the values in that column, it would be nice to format the header over multiple lines to reduce the overall width of the columns.

(println
 (t/table [{:name :a :title "An Extra Long Title" :align :right}] [{:a 1} {:a 2} {:a 3}]))

Current output

|---------------------|
| An Extra Long Title |
|---------------------|
|                   1 |
|                   2 |
|                   3 |
|---------------------|

Desired (example)


|------------|
|  An Extra  |
| Long Title |
|------------|
|          1 |
|          2 |
|          3 |
|------------|

Note that in this example, the header is wrapped but also centered (which could be added with a new option :header-align :center.

In my use case I don't need doric to auto wrap, rather when I supply a header with a \n, doric should assume that implies wrapping is desired. Currently if you add a \n in the title, you get:

|---------------------|
| An Extra
Long Title |
|---------------------|
|                   1 |
|                   2 |
|                   3 |
|---------------------|
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

1 participant