diff --git a/skbase/base/_pretty_printing/_object_html_repr.py b/skbase/base/_pretty_printing/_object_html_repr.py
index 1c4fc017..d5a7ee68 100644
--- a/skbase/base/_pretty_printing/_object_html_repr.py
+++ b/skbase/base/_pretty_printing/_object_html_repr.py
@@ -61,6 +61,51 @@ def _sk_visual_block_(self):
return self
+def _params_to_html_table(estimator):
+ """Generate an HTML parameter table for an estimator.
+
+ Instead of showing a raw ``str(estimator)`` inside a ``
`` block,
+ this function builds a two-column HTML table: one column for the
+ parameter name and one for its current value.
+
+ Parameters
+ ----------
+ estimator : BaseObject
+ The estimator whose ``get_params(deep=False)`` will be used.
+
+ Returns
+ -------
+ str
+ HTML string of a ``
`` element, or empty string when the
+ estimator has no parameters or no ``get_params`` method.
+ """
+ if not hasattr(estimator, "get_params"):
+ return ""
+
+ params = estimator.get_params(deep=False)
+ if not params:
+ return "No parameters"
+
+ rows = []
+ for param_name, value in sorted(params.items()):
+ value_str = html.escape(repr(value))
+ escaped_name = html.escape(param_name)
+ rows.append(
+ f"
"
+ f'
'
+ f'{escaped_name}
'
+ f'
{value_str}
'
+ f"
"
+ )
+
+ return (
+ '
'
+ "
Parameter
Value
"
+ "" + "".join(rows) + ""
+ "
"
+ )
+
+
def _write_label_html(
out,
name,
@@ -68,9 +113,11 @@ def _write_label_html(
outer_class="sk-label-container",
inner_class="sk-label",
checked=False,
+ estimator=None,
):
"""Write labeled html with or without a dropdown with named details."""
- out.write(f'
')
+ out.write(f"
")
+ out.write(f'
')
name = html.escape(name)
if name_details is not None:
@@ -79,12 +126,30 @@ def _write_label_html(
checked_str = "checked" if checked else ""
est_id = uuid.uuid4()
+
+ # Show a structured param table when possible; fall back to
.
+ if estimator is not None and hasattr(estimator, "get_params"):
+ table_html = _params_to_html_table(estimator)
+ if table_html:
+ dropdown_content = (
+ '