Skip to content

New table style and pandas MultiIndex issues #2408

Open
@jorisvandenbossche

Description

@jorisvandenbossche

Follow-up issue on #2209, but I thought better to open a new issue.
There are still some aspects where the new table style does not play very nice with pandas generated tables, more specifically with MultiIndexes

See also the comments in the pandas issue pandas-dev/pandas#15379 (comment), but the main point is that the default alignment of the headers in the new table style makes the interpretation of a table with MultiIndexes (or in general multiple header rows) somewhat confusing:

  • multi-row column headers: due to the right-alignment instead of left alignment, multi-indexed columns get a bit strange:

    screenshot from 2017-02-28 16-07-58

    I don't directly know a way to solve this in a html/css way while keeping the right alignment. In the above case, I think we would ideally want 'A' to be above 'a' ? (which is not the same as left aligning it)
    Anybody an idea about this?

  • multiple row headers: also multi-indexer rows are not ideal because the distinction between the levels is not always clear (the borders are gone, but the shading does not always differ depending on the number of rows in the level).

    In this case, that is OK:

    screenshot from 2017-02-28 16-08-18

    But in the following the shading is the same (and certainly when having more rows in one level label, or different number of rows for different labels, it becomes difficult to see the border between the level labels):

    screenshot from 2017-02-28 16-09-01

    This could be rather easily solved with 'vertical-align: top', which looks better in this case:

    screenshot from 2017-02-28 17-00-34

    But the question of course is whether this will look better in general cases as well. And whether this is something that could be changed in the default jupyter styles? Other option is that pandas includes this in the html output, which would also not be that difficult.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions