From 2f19948ad28396598cf5d9b0ffe46907f02711eb Mon Sep 17 00:00:00 2001 From: jrycw Date: Tue, 17 Sep 2024 19:08:47 +0800 Subject: [PATCH] Add `GT.cols_label()` --- great_tables/_helpers.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/great_tables/_helpers.py b/great_tables/_helpers.py index 3df5cf1f4..29b836b46 100644 --- a/great_tables/_helpers.py +++ b/great_tables/_helpers.py @@ -1085,9 +1085,9 @@ def define_units(units_notation: str) -> UnitDefinitionList: ```{python} ( - GT(df).tab_header( - title="Linear Algebra", subtitle="y={{a_2}}{{x^2}}+{{a_1}}x+{{a_0}}" - ) + GT(df) + .cols_label(a2="{{a_2}}", a1="{{a_1}}", a0="{{a_0}}") + .tab_header(title="Linear Algebra", subtitle="y={{a_2}}{{x^2}}+{{a_1}}x+{{a_0}}") ) ``` @@ -1113,7 +1113,11 @@ def u2html(x: str) -> str: + u2html("{{a_0}}") ) - (GT(df).tab_header(title="Linear Algebra", subtitle=html(subtitle))) + ( + GT(df) + .cols_label(a2="{{a_2}}", a1="{{a_1}}", a0="{{a_0}}") + .tab_header(title="Linear Algebra", subtitle=html(subtitle)) + ) ``` """