Skip to content

API: Would it be useful for everyone if DataFrame.to_html (and to_string) had an argument to specify justify settings for each column? #4315

@numpand

Description

@numpand

related #3190

Currently it is only possible to specify justify settings for column headers. This would extremely useful when used in conjunction with IPython Notebook.

Activity

cpcloud

cpcloud commented on Jul 22, 2013

@cpcloud
Member

i like this idea. want to submit a pr?

jreback

jreback commented on Jul 22, 2013

@jreback
Contributor

is there a standard way of doing this, e.g.

justify = [('foo','left'),('bar','right')]

or

justify_left = ['foo'], justify_right = ['bar']

or

style = dict(justify_left = ['foo'], justify_right = ['bar'])

?

cpcloud

cpcloud commented on Jul 22, 2013

@cpcloud
Member

@jreback i don't know. u don't think this is output-formatting tag material?

jreback

jreback commented on Jul 22, 2013

@jreback
Contributor

yes...but how to you specify to the function that you want to do this? there are other options in html as well (color e.g., that we may want to support in the future). Looking for a general API to pass output-formatting options. Which might be as simple as allowing column_label_formatter, row_label_formatter, cell_formatter as passed functions?

cpcloud

cpcloud commented on Jul 22, 2013

@cpcloud
Member

related #3190

cpcloud

cpcloud commented on Jul 22, 2013

@cpcloud
Member

but #3190 is long term and would require a significant time investment

jreback

jreback commented on Jul 22, 2013

@jreback
Contributor

It think pretty easy to pass a style=Formatter() where formatter is class that we define as a base class and advanced could sub-class. the engines then call out to format rows,columns,cells....

but agreed prob a bit of work to do correctly

cpcloud

cpcloud commented on Jul 22, 2013

@cpcloud
Member

someone could write a package and call it framer or framed to do this....

cpcloud

cpcloud commented on Jul 22, 2013

@cpcloud
Member

Formatter would work tho, while we don't have framed

jreback

jreback commented on Jul 22, 2013

@jreback
Contributor

or maybe Style

jreback

jreback commented on Jul 22, 2013

@jreback
Contributor

and HTMLStyle, TextStyle.....

modified the milestones: 0.15.0, 0.14.0 on Mar 28, 2014

9 remaining items

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    API DesignEnhancementIO DataIO issues that don't fit into a more specific labelIO HTMLread_html, to_html, Styler.apply, Styler.applymap

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      API: Would it be useful for everyone if DataFrame.to_html (and to_string) had an argument to specify justify settings for each column? · Issue #4315 · pandas-dev/pandas