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

Implement the tab_style() method #68

Merged
merged 28 commits into from
Dec 10, 2023
Merged

Implement the tab_style() method #68

merged 28 commits into from
Dec 10, 2023

Conversation

rich-iannone
Copy link
Member

@rich-iannone rich-iannone commented Dec 7, 2023

This adds the tab_style() method. The method requires locations and style values which are provided by new classes in the loc and style submodules.

You could do this:

import great_tables as gt
from great_tables import style, loc
from great_tables import exibble

(
    gt.GT(exibble)
    .tab_style(
        style=style.text(color="blue"),
        locations=loc.body(columns="num", rows=[0, 1, 2, 3]),
    )
    .tab_style(
        style=style.text(size="25px"),
        locations=loc.body(columns=["fctr"], rows=[0, 1, 2, 3]),
    )
    .tab_style(
        style=style.text(color="red"),
        locations=loc.body(columns=["fctr"], rows=[1, 2, 3, 4]),
    )
    .tab_style(
        style=style.text(size="10px"),
        locations=loc.body(columns=["fctr"], rows=[0, 1, 2, 3]),
    )
)

Fixes: #63

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

Successfully merging this pull request may close these issues.

Allow for styling of table cells with the tab_style() method
1 participant