Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enlarge Stub head font #602

Open
corybaird opened this issue Feb 12, 2025 · 1 comment
Open

Enlarge Stub head font #602

corybaird opened this issue Feb 12, 2025 · 1 comment

Comments

@corybaird
Copy link

Prework

Question

How to enlarge stubhead font:


from great_tables import GT, style, loc, exibble

gt_table = GT(df_final.head(3))

gt_table.cols_width(
        cases={
            "Count (Total)": "150px",

        }
    ).tab_style(
        style=style.text(size="30px"),
        locations=loc.body(columns=list(df_final.columns)
                          ),
    ).tab_style(
        style=style.text(size="30px"),  # Adjust size as needed
        locations=loc.stubhead()  # This should target the stubhead
    )

@jrycw
Copy link
Collaborator

jrycw commented Feb 23, 2025

I'm not entirely sure what the issue might be. Could it be that GT.tab_stubhead() wasn't called beforehand? When using GT.tab_style(), I'm able to adjust the text size of stubhead with the following code:

from great_tables import GT
from great_tables.data import gtcars

gtcars_mini = gtcars[["model", "year", "hp", "trq"]].head(5)

(
    GT(gtcars_mini, rowname_col="model")
    .tab_stubhead(label="car")
    .tab_style(
        style=style.text(size="30px"),  
        locations=loc.stubhead()
    )
)

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants