pandas-dev / pandas

Flexible and powerful data analysis / manipulation library for Python, providing labeled data structures similar to R data.frame objects, statistical functions, and much more
https://pandas.pydata.org
BSD 3-Clause "New" or "Revised" License
43.91k stars 18.03k forks source link

DOC: pandas.DataFrame.to_html additional description for the border parameter #60148

Open ivor25 opened 4 weeks ago

ivor25 commented 4 weeks ago

Pandas version checks

Location of the documentation

https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.to_html.html

Documentation problem

pandas.DataFrame.to_html parameter border is missing description for the behaviour when the border=0 or border=False is passed.

This means that documenation should be extended, as if the border=0 or Falseis passed, the border is not present in the output <table> tag. Documentation indicates that border will always be included but this is lie. This behaviour was introduced in the pandas 1.5.0: https://pandas.pydata.org/pandas-docs/version/1.5.0/whatsnew/v1.5.0.html#:~:text=to_html()%20now%20excludes%20the%20border%20attribute%20from%20%3Ctable%3E%20elements%20when%20border%20keyword%20is%20set%20to%20False.

Suggested fix for documentation

Improved description for the border parameter:

border: int or bool When an integer value is provided, it sets the border attribute in the opening

tag, specifying the thickness of the border. If False or 0 (zero) is passed, the border attribute will not be present in the <table>tag.

The default value for this parameter is governed by pd.options.display.html.border.

ivor25 commented 4 weeks ago

take