with_tooltip
='dotted', color='blue') with_tooltip(label, tooltip, text_decoration_style
Create HTML text with tooltip functionality for use in GT table cells.
The with_tooltip()
function creates an HTML <abbr>
element with a tooltip that appears when users hover over the text. The text can be styled with customizable underline styles and colors to indicate it’s interactive.
Parameters
label : str
-
A string that will be displayed as the visible text.
tooltip : str
-
A string that will appear as the tooltip when hovering over the label.
text_decoration_style : Literal['solid', 'dotted'] | None = 'dotted'
-
A string indicating the style of underline decoration. Options are
"solid"
,"dotted"
, orNone
. If nothing is provided, then"dotted"
will be used as a default. color : str | None = 'blue'
-
A string indicating the text color. If
None
, no color styling is applied. If nothing is provided, then"blue"
will be used as a default.
Returns
: str
-
An HTML string containing the formatted tooltip element.