Skip to content

DOC: "justify" parameter in to_html #17527

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

Closed
gfyoung opened this issue Sep 14, 2017 · 3 comments
Closed

DOC: "justify" parameter in to_html #17527

gfyoung opened this issue Sep 14, 2017 · 3 comments
Labels
Bug Docs IO HTML read_html, to_html, Styler.apply, Styler.applymap
Milestone

Comments

@gfyoung
Copy link
Member

gfyoung commented Sep 14, 2017

The Travis docs for to_html states that the only accepted parameters for justify are left and right.

However, I stumbled upon the fact that you can also pass in center, and it will work just fine (i.e. the cell elements and headers are centered), as evidenced by the code:

style = "text-align: {just};".format(just=self.fmt.justify)
row.extend([single_column_table(c, self.fmt.justify, style)
for c in self.columns])

@TomAugspurger : Should we continue to allow only left and right or should we expand to accept center ? I'm personally up for the latter but wanted to get consensus first.

@gfyoung gfyoung added Docs IO HTML read_html, to_html, Styler.apply, Styler.applymap labels Sep 14, 2017
@TomAugspurger
Copy link
Contributor

Presumably all these work? https://developer.mozilla.org/en-US/docs/Web/CSS/text-align

+1 for anything that’s valid html / css

@gfyoung
Copy link
Member Author

gfyoung commented Sep 14, 2017

@TomAugspurger : I believe that's only a subset according to pandas 😉

df = DataFrame()
print(df.to_html(justify="augspurger"))  # your name is also valid

<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: augspurger;">
      <th></th>
    </tr>
  </thead>
  <tbody>
  </tbody>
</table>

@gfyoung gfyoung added the Bug label Sep 14, 2017
@gfyoung
Copy link
Member Author

gfyoung commented Sep 14, 2017

Looks like we need to do some validation on the justify parameter.

gfyoung added a commit to forking-repos/pandas that referenced this issue Oct 3, 2017
gfyoung added a commit to forking-repos/pandas that referenced this issue Oct 3, 2017
@jreback jreback added this to the 0.21.0 milestone Oct 3, 2017
gfyoung added a commit that referenced this issue Oct 3, 2017
BUG: Validate the justify parameter in to_html

Closes gh-17527.
ghost pushed a commit to reef-technologies/pandas that referenced this issue Oct 16, 2017
BUG: Validate the justify parameter in to_html

Closes pandas-devgh-17527.
alanbato pushed a commit to alanbato/pandas that referenced this issue Nov 10, 2017
No-Stream pushed a commit to No-Stream/pandas that referenced this issue Nov 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Docs IO HTML read_html, to_html, Styler.apply, Styler.applymap
Projects
None yet
Development

No branches or pull requests

3 participants