-
Notifications
You must be signed in to change notification settings - Fork 39
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
Multilevel tables #175
Comments
Hi @jariji ! A feature like this requires that the printing mechanism is aware of the data it is printing. In PrettyTables.jl, we treat everything as a 2D table. This additional process would be performed entirely before printing the table. To keep things simple inside PrettyTables.jl, I think it is better to add this functionality in another package that depends on PrettyTables.jl. This new package would pre-process the data and pass it to PrettyTables to render it. Makes sense? |
This essentially, at low level, requires "spanner column label" support (x-ref https://gt.rstudio.com/index.html). The other question is how to signal printing mechanizm that spanner should be used, but first even a possibility of such spanner would have to be added. @jariji - to start with could you maybe show how you want |
I had in mind a terminal display like this
I'm currently making LaTeX tables and I would like to have the "spanner" output |
Thank you, but we need to be more precise than this (sorry for being picky, but such design discussions are usually detailed - probably you saw it already in DataFrames.jl issues). The current way this table is printed in text/plain is:
do you want it to be instead:
While we are at it - is one level of such unnesting enough or would you expect it to support more levels of unnesting? (I am not saying that this is what @ronisbr can do - I have not asked him about it, but to start with I think we need precise requirements and then, 1) @ronisbr can decide what is possible, 2) we need to discuss the API - the point is, as @ronisbr noted, that it would have to be consistent across Tables.jl tables) I know that you are working with LaTeX backend now. In PrettyTables.jl LaTeX has not been worked on yet. However, in general, if we add some functionality I assume that @ronisbr prefers it to be consistent across plain text, HTML, and LaTeX backends (as otherwise very quickly the complexity of the options will not be manageable). |
By the way, this table can be printed as it is if we do not need to align the label We can go two ways here:
|
I agree it would be best. In particular we should dispatch such a recipe on column |
It would be useful if a hierarchical table could be rendered hierarchically, like in Pandas. Especially for Latex output when I have hierarchical data. Currently I can use
headers=
manually, but it would be nice if it could happen automatically.The text was updated successfully, but these errors were encountered: