From a57cd4434d1c9b1821fa5b7d55f36af82a99bda2 Mon Sep 17 00:00:00 2001 From: Shashwat Agrawal Date: Sun, 2 Feb 2025 21:20:13 +0530 Subject: [PATCH 1/2] should work --- pandas/core/frame.py | 10 +++++++--- pandas/io/formats/format.py | 11 ++++++++--- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/pandas/core/frame.py b/pandas/core/frame.py index 3669d8249dd27..c6fa2bf5ecc08 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -3205,9 +3205,13 @@ def to_html( Convert the characters <, >, and & to HTML-safe sequences. notebook : {True, False}, default False Whether the generated HTML is for IPython Notebook. - border : int - A ``border=border`` attribute is included in the opening - `` tag. Default ``pd.options.display.html.border``. + 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 `
` tag. + The default value for this parameter is governed by + ``pd.options.display.html.border``. table_id : str, optional A css id is included in the opening `
` tag if specified. render_links : bool, default False diff --git a/pandas/io/formats/format.py b/pandas/io/formats/format.py index 46ecb2b9a8f12..90f2a6f9d8aba 100644 --- a/pandas/io/formats/format.py +++ b/pandas/io/formats/format.py @@ -897,9 +897,14 @@ def to_html( ``
`` tag, in addition to the default "dataframe". notebook : {True, False}, optional, default False Whether the generated HTML is for IPython Notebook. - border : int - A ``border=border`` attribute is included in the opening - ``
`` tag. Default ``pd.options.display.html.border``. + 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 `
`tag. + + The default value for this parameter is governed by + ``pd.options.display.html.border``. table_id : str, optional A css id is included in the opening `
` tag if specified. render_links : bool, default False From c4f6a02a3ed39ad32f9883c75e70f3669e2141cc Mon Sep 17 00:00:00 2001 From: Shashwat Agrawal Date: Tue, 4 Feb 2025 10:07:00 +0530 Subject: [PATCH 2/2] fix: proper backticks --- pandas/core/frame.py | 4 ++-- pandas/io/formats/format.py | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/pandas/core/frame.py b/pandas/core/frame.py index c6fa2bf5ecc08..04df6e65f4a59 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -3208,8 +3208,8 @@ def to_html( 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 `
` tag. + If ``False`` or ``0`` is passed, the border attribute will not + be present in the ``
`` tag. The default value for this parameter is governed by ``pd.options.display.html.border``. table_id : str, optional diff --git a/pandas/io/formats/format.py b/pandas/io/formats/format.py index 90f2a6f9d8aba..b7fbc4e5e22b7 100644 --- a/pandas/io/formats/format.py +++ b/pandas/io/formats/format.py @@ -900,9 +900,8 @@ def to_html( 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 `
`tag. - + If ``False`` or ``0`` is passed, the border attribute will not + be present in the ``
`` tag. The default value for this parameter is governed by ``pd.options.display.html.border``. table_id : str, optional