Skip to content

Compat with jupyter's new HTML table style #15379

Closed
@jorisvandenbossche

Description

@jorisvandenbossche

See also discussion in jupyterlab/jupyterlab#961

With the upcoming notebook 5.0 release and in current jupyterlab, jupyter has a new (much better!) default HTML table styling. The only problem is that it fixes the width of columns hardcoded at 150 px.

IMO this is a problem. Not the default as such, but the fact that you cannot easily change this when you want to see long table content. The result is that when having cells/column names with long content (and sometimes you deliberately create such cells/column names), it is impossible to inspect those data with the default repr.
Only solutions are to inspect specifics such as df.values or df.columns.

Another consequence is that the pd.options.display.max_colwidth option becomes useless.

Possible way forward:

  • override the max-width for our html repr's to set it to 'none' (@TomAugspurger shows here that this is possible: New table style truncates columns jupyterlab/jupyterlab#961 (comment))
  • if we like the more narrow default, we can always decrease the default for pd.options.display.max_colwidth (currently 50 chars) at the same time. The the default looks similar to jupyter's one, but you have still the ability to adjust it with our options.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Output-Formatting__repr__ of pandas objects, to_string

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions